I use master pages and I want to dynamically add hidden text fields to the form with the NAMES that Google Checkout expects.
<input name="item_name_1" type="hidden" value="Widget #1"/>
Using VB.NET, I am executing the following code
'Name
Dim hidName As New HtmlInputHidden
hidName.ID = "item_name_" & count.ToString
hidName.Value = item
Form.Controls.Add(hidName)
But since I use master pages, the control is renamed to "ctl00 $ item_name_1".
<input name="ctl00$item_name_1" type="hidden" id="ctl00_item_name_1"
Note that I tried to set the Name property (hidName.Name = "item_name_" and count.ToString), and also tried to add the name to the attribute list. This strangely did not affect the name attribute. When I do not use the master page, I notice that when I set the ID property, the user NAME is assigned the same value.
Is there a way to control the name of a dynamically added control when using master pages?