tags:

views:

30

answers:

2

Hi,

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?

A: 

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.

DOK
I have to say I thought there might be some attribute I can apply to my action methods to do this but this will do too. Thanks.
oykuo
A: 

Have you tried using a PartialView? That way you can re-use the same code again and again and simply change the parameters.

Or is that not what you're asking? if not then could you post some code?

griegs