C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Training   ASP.NET Web Hosting    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

Play Silverlight Games or Submit your Silverlight applications and earn 90% AdSense revenue.

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Resources » Code Snippets » ASP.NET WebForms »

Popup window in ASP.NET


Posted Date: 14 Dec 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: DharmarajMember Level: Diamond    
Rating: Points: 8



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




Responses

Author: Abhinav Misra    14 Dec 2008Member 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 2008Member Level: Diamond   Points : 0
Hi,

Thank for that.

It was a useful one.

Regards,
Pradeep Y


Author: Deepika Haridas    18 Dec 2008Member Level: Diamond   Points : 1
Hi,
Good one..
Thanks for posting it.
Keep going on..

Regards,
Deepika



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Popup window in ASP.NET  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Retrive Data from database in aspx file using Stored Procedure and class file
Previous Resource: Multiple File Upload
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use