in ASP.net, To avoid such XSS attacks, all MVC Controller's actions by default don't process the request and send back error if any HTML code is sent in the request.
In case you want some Controller action to allow HTML in the requests, use the decorator ValidateInput(false) on the action method:
classMoneyTransactionController:Controller{[ValidateInput(false)]publicActionResultTransfer(){ //business logic to handle money transferreturnView();}}
And in case you want to allow HTML for some specific field in a form instead of the whole Controller Action, use AllowHTML at the property level in the Model of the data.