Click here to Skip to main content
15,895,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi.
I want to redirect to multiple url in server side in asp.net 4(C#).
When i write Response.redirect(url) 3 times in code, first redirect works.
how can i solve this problem?

my code is below and is not worke correctly.
protected void libraryButton_Click(object sender, EventArgs e)
{
//librarylist is CheckListBox
string url = libraryBox.Text;
string url1 = libraryBox1.Text;
string url2 = libraryBox2.Text;
if(librarylist.Items[0].Selected)
Response.Redirect(url);
if(librarylist.Items[1].Selected)
Response.Redirect(url1);
if(librarylist.Items[2].Selected)
Response.Redirect(url2);
}



thank you.
Posted

1 solution

can you confirm why you want to redirect to three pages, instead of redirecting when you click on back button displau your 1st two pages as popups and redirect to the third url which should definately solve your problem.

for opening popup u can use Page.regiserStartupScript(-----------------) method.

hope this meets your criteria.....
 
Share this answer
 
Comments
r.kh 14-Apr-13 12:22pm    
i want to provide a multi select checkbox for user, when a user check all of checkboxs, site search users selection's in 3 search engin.
Raj Parashar 14-Apr-13 12:25pm    
So u use the same solution as provided above with passing query strings and that should not be a problem.

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