response.redirect in asp.net in new tab

Here we will discuss how we can redirect to a new tab in asp.net. By default when you use Response.Redirect(“Page URL”) it will open in the same tab. But my requirement was to open in new tab instead of the same page.

Also you can read:
 If Else statements in JavaScript Example

– Tutorial on MVVM with WPF

– Working with Content Type Hub in SharePoint 2013

By default the button code will be like this:
<asp:Button ID=”btnSearch” OnClick=”btnSearch_Click” Text=”Click Here” runat=”server” />

And the button click code will be simple:

Response.Redirect(“https://www.google.com/”);

To open in new tab add the below tag in the button control in .aspx page

OnClientClick=”document.forms[0].target = ‘_blank’;”

The button code should look like below:


<asp:Button ID=”btnSearch” OnClick=”btnSearch_Click” Text=”Click Here”
runat=”server” OnClientClick=”document.forms[0].target = ‘_blank’;” /></div>

Hope this will be helpful


You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →

Leave a Reply