Click here to Skip to main content
15,902,492 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Response.Redirect("Default3.aspx?Name=" + 
Repeater1.Items[0].FindControl("id_string").ToString());       


show this

System.Web.UI.WebControls.TextBox

i want to redirect the value of textbox not type of control
Posted

1 solution

FindControl returns a control so you need to cast it as a TextBox to be able to get it's Text value.

For example:
C#
TextBox txtId = Repeater1.Items[0].FindControl("id_string");
if (txtID != null)
{
  Response.Redirect("Default3.aspx?Name=" + txtID.Text);
}



By the way, I would suggest naming your pages to something more descriptive than Default3.aspx as well as use control names that make more sense, such as txtID rather than id_string.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900