Andy
Andy

Reputation:

ASP.Net MVC - Posting dynamically created fields to an action

I have a page that has fields dynamically loaded via JQuery. It allows a user to add additional fields and data on the fly. Currently that data is collected via JQuery and sent via an Ajax request to be dealt with.

But is there anyway of doing this in a normal action post? Currently it seems that the dynamically inserted fields are not being included in the post. I tried using FormCollection as a parameter to my Action, but that didnt seem to work.

Upvotes: 1

Views: 308

Answers (1)

redsquare
redsquare

Reputation: 78667

Have you created these fields correctly, remember you must include a name attribute and ensure they are inside the form you are posting. Maybe if you could paste your jquery script we could assist more.

Upvotes: 1

Related Questions