I understand that you can access the server-side HTML control (which has "runat=server") from code behind in C# with FindControl. But my HTML table is a dynamic table, so I can't use it server-sided. How can I get the Rows.Count of this HTML table without "runat=server"? many thanks. UPDATE: After look around, I've encounter some solutions involving postback after assign the value to a hidden field. The point is, the hidden field must be in a physical and seperate html form, while I'm developing a DotNetNuke module control on a ascx file, which inherited the module form. If I add another form, it will says that I can't have 2 forms with runat=server. Still looking for a solution here.
How to access HTML control in C# code behind without "runat=server"?
3k views Asked by Harry At
3
You can access an HTML control from code behind if it's server side, i.e. if it has the
runat="server"
attribute.If your table is filled by some javascript code, you could save the rows number in a form field before the postback.