i want to open a new pop up window when user click the button.But nw i facing a problem, how can i open a new pop up window based on server.mapPath?
Here is my coding
StringBuilder sb = new StringBuilder();
sb.Append("<script>");
sb.Append("window.open(" + Server.MapPath("~/reportPreview.aspx") + ", '', '');");
sb.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(),"test", sb.ToString());
But i cant open a new window . Please help 🙁
window.openexpects a URL like “../reportPreview.aspx”, butServer.MapPathreturns a physical path like “C:\YourApp\reportPreview.aspx”. You should callResolveClientUrlinstead. Also, you need to add quotes around the URL: