I am working on an fairly simple CRUD application in ASP.NET MVC. The rule for handling anchor tag inputs are fairly straight forward:
All text inputs contains anchor tags
are saved as-is in the database and
will be encoded as HTML entities when
rendering to the view.
Currently I am doing this one by one for each text field in the view .aspx page but I think there’s gotta be a better way to do this in ASP.NET MVC. Can someone tell me how?
Could you inherit from the basic text field control (TextBox?) and customize that control, then use it wherever it’s needed? I’ve seen lots of situations where developers create customized controls with validation controls added optionally.