473,325 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Adding ID to button at run time inside while loop

29
hi all,
can anybody solve my probelm in asp.net using c#.

i am creating button inside while loop at runtime in html page.i just want to give different ID for different button inside while loop.how can i do that. any suggestion?any id but it should be unique.
here is my code.




Expand|Select|Wrap|Line Numbers
  1. <table style="z-index: 112; left: 24px; width: 653px; position: absolute; top: 72px;height: 344px" border="1">
  2.     <%      
  3.        while (rdr.Read())
  4.              {
  5.     %>
  6.            <tr height="5">
  7.                 <td style="width: 261px; height: 6px"><% Response.Write(rdr["comment"].ToString());%></td>
  8.                   <td style="width: 261px; height: 6px"><% Response.Write(rdr["comment"].ToString());%></td>
  9.                   <td style="width: 261px; height: 6px">
  10.                   <% Response.Write(rdr["comment"].ToString());%><br />
  11.                   <asp:Button ID="button2"  runat="server" Width="153px" Height="24px" Text="Reply"></asp:Button></td>
  12.                          </tr>
  13.                          <%  
  14.               } 
  15.  
  16. %>
  17. </table>
Feb 21 '07 #1
1 1672
kenobewan
4,871 Expert 4TB
Here is an article that may help:
ASP.Net Dynamic Controls (Part 1)
Feb 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: David | last post by:
I have an array that contains numbers in string elements , i want to convert this to integers, i have made a for loop that uses the number of elements in the array and then adds 0, thereby...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
0
by: sonic | last post by:
hello, I have this custom datagrid control, that inherits from DataGrid. In addition to datagrid, I am adding a "status" table under it, and another html button, which will trigger a new row. ...
7
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.