ASP.NET button that calls another webform in a pop-up --- please help!!

A

almurph

Hi everyone,


I have an APS.NET (v1.1) type button on a webform page. What I want
it to do is when the user clicks it, it then calls another webform
page that appears in a pop-up window.
Now I know that the button has an "onclick" attribute but that's as
far as I get. I guess you need some Javascript and something in the
code behind file (which for me is VB.NET) but I don't know what.

Can anyone out there help me please? I would appreciate any code-
samples/suggestions/comments that anyone has to offer. Any advice much
appreciated...

Thanks,
Al.
 
N

Norman Yuan

Probably you have already know you can only open a new browser window with
client side script (Java/JScript). Yes, you only need to attach a piece of
javascript to open a new window that calling another webform/page. Here is
an example:

private void Page_Load(....)
{
if (!Page.IsPostBack)
{
...
Button1.Attributes.Add("onlick","window.open('http://www.thesite.com/thepage.aspx','New
Window');return false;")
}

...
}

if you still want the button click causes post back, you can remove "return
false;" part.
 

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,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top