This following code will explain how to create popup window using ASP.NET Create two webforms Place a button in first webform and in the Page_Load of the first form write the following code.
//onclick attribute which denotes the client side script to be called //window.open() is a method in the javascript which is used to open a //new window,you can specify the width and height of the popup window. //popup.aspx denotes the webform to be openend, you can specify your own url to be opened
protected void Page_Load(object sender, EventArgs e) { btnpop.Attributes.Add("onclick", "window.open('popup.aspx','','height=100,width=200');return false"); }
Regards, Dharma
|
| Author: Abhinav Misra 14 Dec 2008 | Member Level: Silver Points : 1 |
thanks for this
as far as im getting it btnpop.Attributes.Add ->is for adding custom attribute in menefest for btnpop.
|
| Author: Pradeep Iyer 18 Dec 2008 | Member Level: Diamond Points : 0 |
Hi,
Thank for that.
It was a useful one.
Regards, Pradeep Y
|
| Author: Deepika Haridas 18 Dec 2008 | Member Level: Diamond Points : 1 |
Hi, Good one.. Thanks for posting it. Keep going on..
Regards, Deepika
|