Open a new web page in a web form? Please help!!

L

Larry

Hi All,

How I can open a new web page in a web form?

I know response.redirect("...aspx") will re-direct the current page to another.
However, what I want is to remain the current page unchange and by clicking
a button on current form to open a new web page.

Any assistance is highly appreciate.

Cheers

Larry
 
D

Dave Fancher

Opening a new window is a client side operation and not directly
controllable from the server. You'll have to have your page emit some
javascript that calls window.open(). You can use the
Page.RegisterStartupScript() or Page.RegisterScriptBlock() methods to easily
accomplish this. I've provided the links to the MSDN documentation for easy
reference.

http://msdn.microsoft.com/library/d...mwebuipageclassregisterstartupscripttopic.asp

http://msdn.microsoft.com/library/d...uipageclassregisterclientscriptblocktopic.asp
 
C

Cor Ligthert

Larry,

Have you thought what you want to do with that extra page?

Often is creating a textbox on the currentpage the goal that is wanted to be
achieved when people ask this question.

(Use panels that you make visible and invisible for that).

And that is much easier to do.

Cor
 
A

Aquila Deus

Larry said:
Hi All,

How I can open a new web page in a web form?

I know response.redirect("...aspx") will re-direct the current page to another.
However, what I want is to remain the current page unchange and by clicking
a button on current form to open a new web page.

Any assistance is highly appreciate.

<form runat="server" id="myForm" target="_blank"> should work.

If you don't want to open new pages for all buttons' clicks, you will
need javascript to change myForm's target at client-side.
 
K

Ken Tucker [MVP]

Hi,

Another option is to convert the aspx page to a control and add the
control to a panel.

http://msdn.microsoft.com/library/d...walkthroughconvertingwebformtousercontrol.asp

Ken
------------------------
Hi All,

How I can open a new web page in a web form?

I know response.redirect("...aspx") will re-direct the current page to
another.
However, what I want is to remain the current page unchange and by clicking
a button on current form to open a new web page.

Any assistance is highly appreciate.

Cheers

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top