Is it possible to launch a secondary window on a button_click?

  • Thread starter Thread starter Morten Wennevik
  • Start date Start date
M

Morten Wennevik

Hi,

I need to launch a new browser window while keeping the current window. This must be done server-side and inside the button-click event as parameters etc will be generated there. How can this be done?

Morten
 
Morten,

Opening new window is a client-side task. You can do it with one of a number
of javascript methods: showModalDialog(), showModelessDialog(), open().
Generate the parameters in your server-side button-click event and then pass
them to client side in hidden input controls. Client side javascript code
will pickup the parameters and open a new window.

Eliyahu

Morten Wennevik said:
Hi,

I need to launch a new browser window while keeping the current window.
This must be done server-side and inside the button-click event as
parameters etc will be generated there. How can this be done?
 
you can use Page.resisterStartupScript

inside the Button_Click server side event , construct javascript to open
new window

string js = "<script>window.open('yourpopup.aspx?param1=" +
SereverSideVariable +"')" );

Page.resisterStartupScript( "somename",js );
 

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

Back
Top