Home > ASP.Net > Make Response.Redirect() open in New Blank Window

Make Response.Redirect() open in New Blank Window


Hi all,

try this example to Make Response.Redirect() open in New Blank Window

1) Open VS2008 and create a new Website Project

2) Add new Web Page and from ToolBox add Button Control

<div>
        <asp:Button ID="btn_Go" runat="server" Text="Button" onclick="btn_Go_Click" OnClientClick ="document.forms[0].target = '_blank';" />
</div>

and In Code behind :-

protected void btn_Go_Click(object sender, EventArgs e)
    {
        Response.Redirect("http://www.google.com");
    }

Hope this helps

Good Luck

Advertisements
Categories: ASP.Net
  1. Sanjeet
    June 24, 2011 at 6:51 am

    it’s really amazing.

  2. February 8, 2014 at 8:43 am

    I honestly believe that this is a pretty post you have there!
    Would you approve if I post your post on my facebook including your
    link and header of your page:”Make Response.Redirect() open in New Blank Window “?
    I found this website as I was browsing for cartilage jewelry and I think
    that I was extremely fortunate for doing so.
    Thank You!!
    The Cartilage Jewelry Group

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: