By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,631 Members | 892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,631 IT Pros & Developers. It's quick & easy.

Dynamically created asp textbox - need to assign a different ID

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.