How to open the New Tab - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > Other Programming - Perl, C++, Java, ASP, .NET Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-04-2011, 06:49 AM   #1 (permalink)
Junior Member
 
Join Date: Jun 2011
Posts: 3
Default How to open the New Tab

Hi..

Am using asp.net.

How to open the new tab at the time of button click?

Can any one tell me the solution.

Thanks in advance.
kapsystem is offline   Reply With Quote
Sponsored Links
Old 07-06-2011, 06:34 AM   #2 (permalink)
t0l
Junior Member
 
Join Date: Jul 2011
Location: Beijing
Posts: 31
Default Re: How to open the New Tab

1):
Response.Write("<script language=\"javascript\">window.open('aaa.aspx','ne w tab,\"toolbar=yes,location=no,directories=yes,stat us=yes,menubar=yes,resizable=yes,scrollbars=yes\") ;</script>");

2):
string strScript = "";
strScript += "<script language=\"javascript\">\n";
strScript += "window.open('aaa.aspx','新窗口,\"toolbar=yes,locatio n=no,directories=yes,status=yes,menubar=yes,resiza ble=yes,scrollbars=yes\");\n";
strScript += "location.href='index.html';";
strScript += "</script>";

bool b = ((Page)System.Web.HttpContext.Current.Handler).IsS tartupScriptRegistered("PopUp");
if (!b)
{
((Page)System.Web.HttpContext.Current.Handler).Reg isterStartupScript("PopUp",strScript);
}
Others:
1.Response.Redirect("XXX.aspx",true)
2. Response.Write("<script>window.open(XXX.aspx','_bl ank')</script>")
3.Response.Write("<script>window.location=XXX.aspx '</script>")
4.Server.Transfer("XXX.aspx")
5.Response.Write("<script>window.showModelessDialo g(XXX.aspx')</script>")
t0l is offline   Reply With Quote
Old 09-16-2011, 05:44 AM   #3 (permalink)
Junior Member
 
Join Date: Aug 2011
Posts: 11
Default Re: How to open the New Tab

you can also try this

<asp:Button ID=”btnNewEntry” runat=”Server” CssClass=”button” Text=”New Entry” OnClick=”btnNewEntry_Click” OnClientClick=”aspnetForm.target =’_blank’;”/>

<%– aspnetForm.target =’_blank’ will add handler to open new tab–%>

protected void btnNewEntry_Click(object sender, EventArgs e)
{
Response.Redirect(”New.aspx”);
}

OR

Response.Write( “<script> window.open( ‘pageName.aspx’ ); </script>”);
Response.End();

// Here we can write javascript code to open new tab


shrnmlss
shrnmlss6 is offline   Reply With Quote
Old 10-20-2011, 01:29 AM   #4 (permalink)
Regular User
 
petsimcox002's Avatar
 
Join Date: Aug 2011
Location: Pasadena, CA
Posts: 195
Default Re: How to open the New Tab

nice, script on asp.net thanks
petsimcox002 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:15 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting