Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dynamically created asp textbox - need to assign a different ID

Reply
Thread Tools

Dynamically created asp textbox - need to assign a different ID

 
 
Shilpi Chaudhry
Guest
Posts: n/a
 
      09-14-2004
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
 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      09-15-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
Assign onkeypress-function to dynamically created input-boxes vega80 Javascript 1 10-30-2006 12:37 AM
Dynamically assign textbox ID to a textbox variable in a loop? =?Utf-8?B?ZGF2aWQ=?= ASP .Net 7 04-05-2006 06:53 PM
Managing ViewState of a dynamically created Custom Composite Server Control -(where the original is also dynamically created) dickster ASP .Net Building Controls 0 12-08-2005 09:32 AM
Capturing Data of Dynamically Created TextBox's Jack Johnston ASP .Net 5 07-28-2003 09:57 AM



Advertisments