Wednesday, 23 October 2013

Open New Window as Popup with defined size on Button Click using C#

Use this Code on button click event:

ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( 'popup.aspx', null, 'height=500,width=560,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=\'+Mtop+\', left=\'+Mleft+\'' );", true);

No comments:

Post a Comment