Friday, September 30, 2011

Open Popup Wnidow With QueryString asp.net C#


How to open pop window using asp.net c#.
Here code descibes how to open popup window with passing a query string in popup page.

string popup = "<script language='javascript'>" + "window.open('poppage.aspx?data=" + HttpUtility.UrlEncode(qs.ToString()) + "','CustomPopUp', " + "'fullscreen=no,height=330,width=350,top=250,left=250,scrollbars=yes, dependant = yes, alwaysRaised = yes, menubar=no,resizable=no')" + "</script>";
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "PopupScript", popup,false);

If you want only popup message code is given below.
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(),"MyMessage","alert('Please enter!')", true);