How to get value of repeat same id name text box item in web

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am developing web page using asp.net with c# coding. I would like to know how can i get the value of repeat same id name text box item in my aspx web page
Let say i have textbox name "txtname". and it actually appears in the web page many time as a list. In order for me to get the value in the aspx.cs page, how can i do that

thank

Warm regards
Zachary
 
You could use the FindControl method

// Assuming multiple instances of the "txtname" control
foreach(Control ctl in this.Controls

if(ctl.ID == "txtname"

TextBox txtFound = (TextBox)ctl;
// do somethin



Cheers
Jonathan Rucker

----- Zachary wrote: ----

Hi

I am developing web page using asp.net with c# coding. I would like to know how can i get the value of repeat same id name text box item in my aspx web page
Let say i have textbox name "txtname". and it actually appears in the web page many time as a list. In order for me to get the value in the aspx.cs page, how can i do that

thank

Warm regards
Zachary
 
Back
Top