473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PostBackURL to new window

I am using Visual Web Developer 2005.

Can I use the button PostBackURL to open a second web form in a new window,
instead of replacing the current page?

Thanks
Bill
Feb 10 '06 #1
3 14833
Hi,

one way is to change form's target when posting

<asp:Button ID="Button1" OnClientClick="form1.target='_blank'"
runat="server" Text="Button" PostBackUrl="~/Default2.aspx" />

You just might also turn it back after posting, in case other buttons still
continue posting on the same page.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"bill" <be****@datamti.com> wrote in message
news:uw**************@TK2MSFTNGP11.phx.gbl...
I am using Visual Web Developer 2005.

Can I use the button PostBackURL to open a second web form in a new
window, instead of replacing the current page?

Thanks
Bill

Feb 10 '06 #2
I'm pleased to report that I figured it out for my self!
In case anybody else cares, put

<base target="_blank"></base>

between the <head></head> tags of the source aspx page.

PostBackURL is a good feature.

-Bill

"bill" <be****@datamti.com> wrote in message
news:uw**************@TK2MSFTNGP11.phx.gbl...
I am using Visual Web Developer 2005.

Can I use the button PostBackURL to open a second web form in a new
window, instead of replacing the current page?

Thanks
Bill

Feb 10 '06 #3
Thanks Teemu, that is a good way to do it.
-Bill
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
Hi,

one way is to change form's target when posting

<asp:Button ID="Button1" OnClientClick="form1.target='_blank'"
runat="server" Text="Button" PostBackUrl="~/Default2.aspx" />

You just might also turn it back after posting, in case other buttons
still continue posting on the same page.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"bill" <be****@datamti.com> wrote in message
news:uw**************@TK2MSFTNGP11.phx.gbl...
I am using Visual Web Developer 2005.

Can I use the button PostBackURL to open a second web form in a new
window, instead of replacing the current page?

Thanks
Bill


Feb 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: osh | last post by:
All, I am having trouble using the PostBackUrl feature in .NET 2.0. I have several User Controls that are on a MasterPage. The User Controls contain the form fields for a basic search on...
2
by: lanem | last post by:
I want to pop open a new window from my asp.net 2.0 web page. I want it to pass or submit the current viewstate to the new window. Does anyone know how to do that? Thanks.
11
by: David Thielen | last post by:
Hi; In a page, when the user clicks on a button, I want to validate all the controls (in the code behind) and then if they are good, leave that page alone and launch a new window with a new url...
4
by: sck10 | last post by:
Hello, Can you use the PostBackUrl to post to different sites? I have a page (PostBackURL.aspx' ) on one website (same server) that has a button set to: PostBackURL="http://zone1.web.com" ...
1
by: Chris | last post by:
Hi, i created an ImageButton within an ItemTemplate of a datalist (in shop.aspx). There are two possibilities: 1) when the user is logged and he clicks on an image, he must be 'postbacked' to...
2
by: noneya22 | last post by:
I'm using asp.net 2.0. I have a page that has a save button and a cancel button along with a text field. All controls are asp.net server controls. I have JavaScript that prompts the user if he...
1
by: joseph | last post by:
Hello Could you help i want to use postbackurl to a new window, not replace previous page. i doing something onclientscript="form1.target='_blank'" postbackurl="~/default2.aspx" is not work.
5
by: James R. Davis | last post by:
I am converting my ASP code to ASP.NET but have run into a hard stop. On several of my pages I must post data to a different page as a result of a submit. With ASP.NET, however, it seems that the...
5
by: Tony | last post by:
Hi, I have two questions: 1) With this code, i never see the alert message. Why? How to see it? Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "myscript", _ " alert('you go to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.