open aspx page popup window using asp.net c#(commandname)
<telerik:RadButton ID="showBtn" runat="server" Text="Show" BackColor="#3399ff" ForeColor="Black" CommandName="Openfile"></telerik:RadButton>
if (e.CommandName.ToString() == "Openfile")
{
GridDataItem item = (GridDataItem)e.Item;
string value = item["ID"].Text;
string url = "../Admin/DuctorPrescriptionDetails.aspx?Patient_Id=" + value;
string s = "window.open('" + url + "', 'popup_window', 'width=790,height=400,left=100,top=100,resizable=no');";
ScriptManager.RegisterStartupScript(this, typeof(string), "script", s, true);
// ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( 'your_page.aspx', null, 'height=700,width=760,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=\'+Mtop+\', left=\'+Mleft+\'' );", true);
}
ClientScript.RegisterStartupScript(typeof(Page), "closePage", "<script type='text/JavaScript'>window.close();</script>");
if (e.CommandName.ToString() == "Openfile")
{
GridDataItem item = (GridDataItem)e.Item;
string value = item["ID"].Text;
string url = "../Admin/DuctorPrescriptionDetails.aspx?Patient_Id=" + value;
string s = "window.open('" + url + "', 'popup_window', 'width=790,height=400,left=100,top=100,resizable=no');";
ScriptManager.RegisterStartupScript(this, typeof(string), "script", s, true);
// ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( 'your_page.aspx', null, 'height=700,width=760,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=\'+Mtop+\', left=\'+Mleft+\'' );", true);
}
ClientScript.RegisterStartupScript(typeof(Page), "closePage", "<script type='text/JavaScript'>window.close();</script>");
Comments
Post a Comment