I have tried to access textbox value based on index
For ex if i have controls TextBox1 and TextBox2 in my aspx page
in my code behind we can access text property like below,
TextBox1.Text = "suresh";
TextBox2.Text = "Rajesh";
but i just want to access based on index like below,
but this is throwing error.
Can pls tell me how can i access control using index?
U can use it this way instead
// Gets the button based on search to a button object
Button btn = (Button) FindControl("Button" + i );
//Sets the value here
btn.Text = "a";
where i is your index hope it helps.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?