harsimranb
harsimranb

Reputation: 2283

Access HTML controls from code behind C#

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

Answers (1)

Diego
Diego

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

Related Questions