Currently I got a big list of invisible input fields, two of them got a runat="server". The names of my input fields change because of the runat="server" and the MasterPage.
See code/output below:
ASP.NET Code
<input runat="server" id="_paymentAmount" type="hidden" />
<input type="hidden" runat="server" id="_shopperEmail" />
C# Code
this._paymentAmount.Attributes.Add("name", "paymentAmount");
this._shopperEmail.Attributes.Add("name", "shopperEmail");
Other solutions I tried:
<asp:HiddenField ID="paymentAmount" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="shopperEmail" runat="server" ClientIDMode="Static" />
But in both ways this is the result:
<input id="_paymentAmount" type="hidden" value="[VALUE]" name="ctl00$_cphContent$_paymentAmount">
<input id="_shopperEmail" type="hidden" value="[VALUE]" name="ctl00$_cphContent$_shopperEmail">
And the result that I want to get is as follows:
<input id="_paymentAmount" type="hidden" value="[VALUE]" name="paymentAmount">
<input id="_shopperEmail" type="hidden" value="[VALUE]" name="shopperEmail">
Does anyone know how to resolve this issue? I cannot accept other names than paymentAmount and shopperEmail. So it's important that I can find a fix for this.
I experimented with other controls and ClientIDMode="Static".
I'm working with ASP.NET 4.5