How can I loop through html controls inside an ASPX page which don't have "runat=server" attribute?
Because of using code blocks and dynamic variables on them I cannot add the attribute:
<input lang='<%= language.ID %>' checked='<%= check(x) %>' />
Depends on what you want you're looking to do.
As the other answers have stated, end of the day, it's all HTML and therefore a
Formwillsubmit(by default anHTTP POSTforASP.Net Web FormshencePostback) somewhere and you can loop throughHttpRequest.Formon the server side (aka "code-behind").As stated, in the end everything renders as a standard HTML element that you can provide
idorclassand "loop" through them and do what you want on the front end.Here's a trivial example:
Hth.