The naming conventions that .NET uses in its HTML controls are driving
me crazy! Pulling one in from a control or within a master page, for
example, causes .NET to add class info to the "name" attribute. So, if
I have a control that contains:
<input class="TextField" id="foo" runat="server"/>
It ultimately renders as <input name="_ctl0:[control ID]:foo"
type="text" id="_ctl0_[control ID]_foo" class="TextField" />
This, of course, makes it problematic to refer to these forms fields
via javascript. I've also got plain-vanilla HTML input fields I'm
rendering via XML that are named properly.
I realize I could convert EVERYTHING over to .NET controls and
validation, but you know what? I don't want to, and I shouldn't have
to. Is there any way to tell .NET to render the Name (it can keep ID)
attribute the way I want, short of creating a custom derived class for
each type of HtmlInput type to override the render method? And if I do
so, will I break things like ViewState?