Click here to Skip to main content
15,917,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I write one application in which onbuttonclick dialog box is displayed.

This dialog box contains text box & button.
Now I want to redirect to another page with value from text box on button click.

For the redirect I write following code
C#
protected void btnDisplay_Click(object sender, EventArgs e)
    {
        string strName;
        string strCountry;
        strName=txtName.Text;
        strCountry = ddlName.Text;
        Response.Redirect("Next.aspx?name=" + strName + "&country=" + strCountry);
    }



But when I click on the button I cannot go to next page.

What am I to do?

Thanks.
Posted
Updated 16-Jan-11 21:47pm
v2
Comments
Dalek Dave 17-Jan-11 3:48am    
Edited for Grammar, Spelling, Syntax and Readability.
R. Giskard Reventlov 17-Jan-11 3:50am    
Have you set a breakpoint to see what happens? Does the code generate an error?
Sandeep Mewara 17-Jan-11 4:10am    
'you cannot' means? What happens?

1 solution

I guess you want to close the dialog and redirect the parent page, right? You could invoke some javascript for that.

Something like:
Response.Write("<script>parent.location.href = 'http://someurl.here';")


Also, have a look here:
http://www.webdeveloper.com/forum/archive/index.php/t-15245.html[^]

http://weblogs.asp.net/ksamaschke/archive/2003/02/23/2831.aspx[^]

Good luck!
 
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