If in the markup you declare a control like this:
<asp:Label runat="server" AssociatedControlID="txtSomeInput">Some Input:</asp:Label>
<asp:Textbox id="txtSomeInput" runat="server" />
Does leaving out the ID from the label control change anything in regards to Viewstate or the Page/Control life cycle? Does it just get some generated ID? Obviously it cannot be referenced in the code-behind at design time (well at least not by the programmer)…Just curious as to if this has any side effects (or tangible benefits)?
Further, I would presume if this control cannot be referenced at design time it can’t really be changed in a way that would add any information to viewstate…yet the runat tag allows the AssociatedControlID to be decided (master page crap ids for example) thus not having to have a html label with a <%# %> to write the clientId??
thanks!
It makes no difference from a functionality perspective. Elements which require an ID to function properly will auto-generate one. It does make referencing the control by name in the code-behind difficult, but still possible, it just requires manually finding it and wiring it.