Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling textbox ids
Message
From
03/12/2002 08:31:18
Rex Mahel
Realm Software, Llc
Ohio, United States
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00728819
Message ID:
00728953
Views:
10
Cathi,

Would I then have to populate each textbox separately, like the checkboxlist, or can I have databinding do this as well?

TIA

Rex

>You can assign the id in the html view of your aspx page. Here is some sample code where the id is assigned:
>
>
><asp:repeater id="DataInputTableElements" datasource=< % ERROR: # items  % >
>runat="server">
>      <itemtemplate>
>          <tr>
>              <th>
>                   time< % ERROR: # Container.DataItem  % >
>              </th>
>              <td>
>                   <asp:textbox id="TextBox1"
>                        cssclass="TextInput" runat="server" />
>              </td>
>              <th>
>                   time< % ERROR: # Container.DataItem  % >
>              </th>
>              <td>
>                   <asp:textbox id="TextBox2"
>                        cssclass="TextInput" runat="server" />
>              </td>
>            </tr>
>    </itemtemplate>
></asp:repeater>
>
>
>Then to iterate through the Textboxes inside the repeater you would use the foreach loop like below:
>
>
>foreach (RepeaterItem ri in myRepeater.Items)
>   {
>    // get the txtbox
>    TextBox txt = ((TextBox)ri.FindControl("myTextbox"));
>   }
>
>
>
>>All,
>>
>>I am creating Web textboxes via a repeater. I know the page creates a unique id for each textbox, but I want to be able to define the ids.
>>
>>I need to be able to pick the textboxes from the page so I can save the values back to the tables.
>>
>>How can I do this?
>>
>>TIA
>>
>>Rex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform