My Code:
using
System;using
System.Data;using
System.Configuration;using
System.Web;using
System.Web.Security;using
System.Web.UI;using
System.Web.UI.WebControls;using
System.Web.UI.WebControls.WebParts;using
System.Web.UI.HtmlControls;using
System.Data.SqlClient;public partial class _Default : System.Web.UI.Page{
dbUtils dbu = new dbUtils(); //SqlDataAdapter dataAdapter; //DataSet dSet; //SqlCommand cmd; //int value; //string Temp,var;protected void Page_Load(object sender, EventArgs e){
if (Page.IsPostBack == false){
session();
}
}
public void session(){
if (Session["sess"] == null){
string popupWindow = null; string testScript = "window.open('Default2.aspx','win','width=500,height=200,scrollbars= yes')";string scriptID = "popup"; string myScript = buildScript(scriptID, testScript);if (!Page.IsStartupScriptRegistered(scriptID)){
Page.RegisterStartupScript(scriptID, myScript);
}
}
}
string buildScript(string id, string output_page){
string myScript = "\n";myScript +=
"<script language='javascript' id='" + id + "'>\n"; //myScript += "window.open('" + output_page + "');\n";myScript += output_page + ";\n";myScript +=
"</" + "script>\n";return myScript;}
protected void lbcasestudy_Click(object sender, EventArgs e)
{
if (Session != null)
{
string script = "window.open('Pdf/','new_Win');";ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", script, true);}
}
protected void lbcasestudy1_Click(object sender, EventArgs e)
{
if (Session != null){
string script = "window.open('Pdf/','new_Win');";ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", script, true);}
}
}
![]() |
-4 |
![]() |
The easiest way to do that is by using the Ajax Control Toolkit Modal Popup, take a look if that is what you need:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx
But I've done it with plain javascript as well, and is not that hard...
Basically you just need to put a layer (div) with some transparency over the window and it will disable every thing under it
L. Skynyrd
Please, mark as answer when appropriate
![]() |
-3 |
![]() |
Have you tried using window.showModalDialog instead of window.open ?
Sincerely,
Peter Mourfield
www.mourfield.com
Please remember to click “Mark as Answer” on the post that helps you.
![]() |
1 |
![]() |
Thank you very much.It is very useful for me but when the pop-up block opens and click the submit button another page should open in the same window...can u give me the suggestion????
![]() |
1 |
![]() |
Thank you very much.It is very useful for me but when the pop-up block opens and click the submit button another page should open in the same window...can u give me the suggestion????
![]() |
-1 |
![]() |
Use the following tag in the <head> tag
<base target="_self" />
It will solve your problem .
![]() |
-1 |
![]() |