Thursday, March 22, 2012

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

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

LarryOpening 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...ripttopi c.asp

http://msdn.microsoft.com/library/d...lock topic.asp

--
HTH
------
Dave Fancher
http://davefancher.blogspot.com

"Larry" <larry@.widextech.com> wrote in message
news:3826632511203079218750@.news.microsoft.com...
> 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
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
Larry wrote:
> 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.
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...usercontrol.asp

Ken
--------
"Larry" <larry@.widextech.com> wrote in message
news:3826632511203079218750@.news.microsoft.com...
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

0 comments:

Post a Comment