Using asp.net mvc 2 c#. I have a dynamic form. I want to get fields from this dynamic form at my controller. How can I get that fields?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Either use a view model and pass this view model to the post action. When you say dynamic it is not clear whether it’s the number that is not known but the structure always the same in which case you could use a collection of a view model
or if the fields are totally arbitrary and dynamic you could use the
Requestobject inside your controller action to read their values. It is a key/value collection containing everything that is sent to the controller.