0

I am trying to develop a simple web part in VS that will pull data from a text box, construct a URL with the data and open a new tab using OnClientClick="aspnetForm.target ='_blank';" and using this on the code behind:

protected void Button1_Click(object sender, EventArgs e)
{
        String myString = TextBox1.Text;

        Response.Redirect("http://..." + myString + "...");
}

This works, but it will only work once from my site without a page refresh. What is the best way to either allow multiple redirects without refresh or just simultaneously refresh the page so the user can enter and search a different parameter?

1
  • This question is borderline to be off topic (remove the webpart part and it is an asp.net question), and I also think it would get more attention on the stackoverflow site Commented Jul 2, 2014 at 5:05

1 Answer 1

1

you can do:

Server.Transfer("Page2.aspx", true);
1
  • Thank you, I should have mentioned that the destination URL is an external site. According to this Server.transfer only works on same server/domains. I tested anyways and they are correct.
    – S0L1D
    Commented Jul 2, 2014 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.