Opening a Pop-Up window using JavaScript

Popup windows are additional browser window opened from a web page.
The popups are opened programmatically using JavaScript.
JavaScript Popup windows are used widely for displaying advertisements.

To open a pop-up window on a button click, the code that can be referred is as below:

btnTest.Attributes.Add(“OnClick”, “‘/MySiteUrl/Pages/PopUp.aspx’, null,
‘height=900, width=1200,status= no, resizable= yes, scrollbars=yes, toolbar=no,
location=no,menubar=no ‘)”);


void btnTest_Click(object sender, EventArgs e)

The different attributes/properties for the new pop up window
can be specified as well.


~ by Neha Sinha on February 1, 2008.

One Response to “Opening a Pop-Up window using JavaScript”

  1. Thank you for the blog. it was very helpful. I just want to give the title of the pop up window, a name. i mean i should give it a to do that. can you help. Thanks

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: