formcollection will not work in my case because I am not binding the model values to the form controls. So form collection will not work in my case.
In my case, I am setting few values during get request and using them during post. I am not dispalying them in my form thats why I used hidden fields.
I cannot use the session approach beacuse there is a custom validation attribute at class level where I need those hidden value fields. And I don't want to use session in my Model and Custom attribute class.
dee_singh
Member
10 Points
10 Posts
Re: How to get rid of hidden fields in ASP.net MVC 2
Nov 29, 2010 03:17 PM|LINK
formcollection will not work in my case because I am not binding the model values to the form controls. So form collection will not work in my case.
In my case, I am setting few values during get request and using them during post. I am not dispalying them in my form thats why I used hidden fields.
I cannot use the session approach beacuse there is a custom validation attribute at class level where I need those hidden value fields. And I don't want to use session in my Model and Custom attribute class.
Any other suggestion?