Reputation: 2283
My webpage generates a lot of HTML dynamically using jQuery to display data. However, I need to access those dynamic HTML controls from C#. I cannot do runat="server", because JQUERY does its magic at runtime, depending on what user selects.
Is there any way to access the HTML of these dynamically created controls from code behind?
Thanks!
Upvotes: 0
Views: 3090
Reputation: 18349
If all you need are values from input fields (input, select, radio, checkbox), just make sure JQuery creates those inside the main <form>
tag, then you can read them in the server side, after the form is submitted, using Request.Form["myFieldName"]
.
Upvotes: 3