C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

Open a popup window in the center position


Posted Date: 08 Jan 2009    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: AbhiMember Level: Gold    
Rating: 1 out of 5Points: 5



This code shows how to opena popup window in the center position


var userWidth = screen.availWidth;

var userHeight = screen.availHeight;

var leftPos;
var topPos;
var popW = 860; //set width here
var popH = 620; //set height here

var settings = 'modal,scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,';

leftPos = (userWidth - popW) / 2,
topPos = (userHeight - popH) / 2;
settings += 'left=' + leftPos + ',top=' + topPos + ',width=' + popW + ', height=' + popH + '';

window.open('popup.aspx', 'childForm', settings);



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

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

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: Set Configuration Settings for a particular folder/page in Web.config
Previous Resource: Javascript enable in client browser or Not
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use