469,270 Members | 1,733 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Dynamically created asp textbox - need to assign a different ID

I have a forloop which I use to create textboxes - but unfortunately
all of them have the same ids - I need to assign different ids to
these textboxes creeated in the loop so that I can retrieve their
corrs values. Anybody??

Code snippet:

<%
int y = 7;
%>

<table style="Z-INDEX: 101; LEFT: 316px; WIDTH: 355px; POSITION:
absolute; TOP: 167px; HEIGHT: 150px">
<%
for(int i=0; i<3; i++)
{
%>
<tr>
<td style="WIDTH: 182px; HEIGHT: 32px">
<asp:label id="Label1" runat="server" Width="127px"
Font-Bold="True">Parameter #</asp:label>
</td>
<td style="HEIGHT: 32px">
<asp:textbox id="ID_PARAMETER_NUMBER" runat="server"
ReadOnly="True" Width="152px "></asp:textbox>
</td>
</tr>
<tr>
<td style="WIDTH: 182px">
<asp:Label id="Label2" runat="server">Parameter Name</asp:Label>
</td>
<td>
<asp:TextBox id="ID_EDIT_PARAMETER_NAME" runat="server"
Width="156" Height="24"></asp:TextBox>
</td>
</tr>
<tr>
<td style="WIDTH: 182px">
<asp:Label id="Label3" runat="server">Value Type</asp:Label>
</td>
<td>
<asp:TextBox id="ID_EDIT_VALUE_TYPE"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="WIDTH: 182px">
<asp:Label id="Label4" runat="server">Value</asp:Label>
</td>
<td>
<asp:TextBox id="ID_EDIT_VALUE" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="WIDTH: 182px">
<asp:Label id="Label5" runat="server">Value Source</asp:Label>
</td>
<td>
<asp:TextBox id="ID_EDIT_VALUE_SOURCE"
runat="server"></asp:TextBox>
</td>
</tr>
<tr></tr>
<tr></tr>
<%
}
%>

</table>

Thanks, Shilpi
Nov 18 '05 #1
1 2824
Shilpi,

I do not use embedding but with code behind you should be alright. If you
need any help with codebehind related snippet which would help then please
do let me know.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Shilpi Chaudhry" <sh*******@yahoo.com> wrote in message
news:46**************************@posting.google.c om...
I have a forloop which I use to create textboxes - but unfortunately
all of them have the same ids - I need to assign different ids to
these textboxes creeated in the loop so that I can retrieve their
corrs values. Anybody??

Code snippet:

<%
int y = 7;
%>

<table style="Z-INDEX: 101; LEFT: 316px; WIDTH: 355px; POSITION:
absolute; TOP: 167px; HEIGHT: 150px">
<%
for(int i=0; i<3; i++)
{
%>
<tr>
<td style="WIDTH: 182px; HEIGHT: 32px">
<asp:label id="Label1" runat="server" Width="127px"
Font-Bold="True">Parameter #</asp:label>
</td>
<td style="HEIGHT: 32px">
<asp:textbox id="ID_PARAMETER_NUMBER" runat="server"
ReadOnly="True" Width="152px "></asp:textbox>
</td>
</tr>
<tr>
<td style="WIDTH: 182px">
<asp:Label id="Label2" runat="server">Parameter Name</asp:Label>
</td>
<td>
<asp:TextBox id="ID_EDIT_PARAMETER_NAME" runat="server"
Width="156" Height="24"></asp:TextBox>
</td>
</tr>
<tr>
<td style="WIDTH: 182px">
<asp:Label id="Label3" runat="server">Value Type</asp:Label>
</td>
<td>
<asp:TextBox id="ID_EDIT_VALUE_TYPE"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="WIDTH: 182px">
<asp:Label id="Label4" runat="server">Value</asp:Label>
</td>
<td>
<asp:TextBox id="ID_EDIT_VALUE" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="WIDTH: 182px">
<asp:Label id="Label5" runat="server">Value Source</asp:Label>
</td>
<td>
<asp:TextBox id="ID_EDIT_VALUE_SOURCE"
runat="server"></asp:TextBox>
</td>
</tr>
<tr></tr>
<tr></tr>
<%
}
%>

</table>

Thanks, Shilpi

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Bhavin | last post: by
8 posts views Thread by Donald Xie | last post: by
3 posts views Thread by Forconi Boris via .NET 247 | last post: by
4 posts views Thread by Craig Buchanan | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.