Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to redirect to next page using link button.I use dialog box which contains text box,when click on link button I want to redirect to next page with value in text box.but I redirect to next page with null value.why?
Posted
Comments
Estys 17-Jan-11 7:30am    
Show what you do, then maybe we can guess the "Why".

1 solution

I think you're passing querystring parameter while redirecting to another page.

Like if your textbox contains value of "glass" then are you sure you're redirecting like below ?

Response.Redirect("page.aspx?product=glass)


You will find glass in a second page like

string prod = Request.QueryString["product"].ToString();


Page redirection depends on the page hierarchy also, And further share your code to be clear the way you're currently doing the same.
 
Share this answer
 
Comments
maya saste 17-Jan-11 8:48am    
Thanks.I try this way but I redirect on next page with null value.on link button click I get null value from text box.code is as follows
protected void lnkBtnDisplay_Click(object sender, EventArgs e)
{
string strName;
string strCountry;

strName =txtName.Text;
strCountry = ddlName.Text;
Response.Redirect("Next.aspx?name=" + strName + "&country=" + strCountry);
}
here I get null value from txtName text box.why?
Hiren solanki 17-Jan-11 8:50am    
I can not assume on why you're getting NULL values on text box may be this is regarding on AutoPostBack Controls are initializing.
Manfred Rudolf Bihy 19-Jan-11 16:20pm    
I've done all the good I can do in one day! 5+

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