In my form I need to insert different inputs of type \"text\". The inputs must be html controls with name and id\'s. Because I send this form to a external url.
For
ClientIDMode="Static"
This usefully locks the ID of any runat="server" control, however it does not lock the 'name' attribute of a html input element.
Seeing in this instance the only reason to have the runat="server" attribute on the input is to use .Net validation, I would suggest using an external JS library such as jQuery to handle this.
If however, like me, you need to alter the value attribute, the only work around I can see is a rather messy one. If you remove the runat="server" from the input, you can place a server control, such as a literal, within the value="" attribute.
For example:
" />
Please don't have a go at me for such bad coding practises, it's intended as a last resort workaround to keep the name attribute from changing to a .Net style name.
Does anyone else know of another way to fix the name? (The form element is not defined as runat="server", but it's embedded within the normal .Net form, which is why the server is attaching it to the main form tree)