Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. popup window

popup window

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    venkata saibabu
    wrote on last edited by
    #1

    public void OpenNewWindow(string url) { string winFeatures = "toolbar=no,status=no,menubar=no,location=center,scrollbars=no,resizable=no,height=300,width=400"; ClientScript.RegisterStartupScript(this.GetType(),"newWindow", string.Format("window.open('{0}', 'yourWin', '{1}');", url, winFeatures)); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["Admin_Id"] != null) { //Lbladminname.Text = "Hi" + Session["username"].ToString(); // Response.Write(Session["username"].ToString()); //Lbladminname.Text = "Dear" + Session["username"].ToString(); //showlastlogindata(); showlastlogindata(); Label lbl = (Label)Master.FindControl("Lbladminname"); Label lblt = (Label)Master.FindControl("Lbltime"); if(lbl !=null) { lbl.Text =" Welcome " + Session["username"].ToString().Trim(); } if (lblt != null) { lblt.Text = DateTime.UtcNow.ToLongDateString().ToString(); } //HttpCookie mycookie = Request.Cookies["link"]; if (Session["link"] != null) { //Response.Write(Session["link"].ToString()); Response.Redirect("PropertyViews.aspx"); } else { OpenNewWindow("Remainder.aspx"); } //Lbllastlogin.Text = Session["username"].ToString(); } else { Response.Redirect("Adminlogin.aspx"); } //addlogs(); } } iam calling the javascript function in Page_load ,its working properly ,but the pop window is not displayed.so please some one help me i have specified my total code above thanks in advance

    A C D 3 Replies Last reply
    0
    • V venkata saibabu

      public void OpenNewWindow(string url) { string winFeatures = "toolbar=no,status=no,menubar=no,location=center,scrollbars=no,resizable=no,height=300,width=400"; ClientScript.RegisterStartupScript(this.GetType(),"newWindow", string.Format("window.open('{0}', 'yourWin', '{1}');", url, winFeatures)); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["Admin_Id"] != null) { //Lbladminname.Text = "Hi" + Session["username"].ToString(); // Response.Write(Session["username"].ToString()); //Lbladminname.Text = "Dear" + Session["username"].ToString(); //showlastlogindata(); showlastlogindata(); Label lbl = (Label)Master.FindControl("Lbladminname"); Label lblt = (Label)Master.FindControl("Lbltime"); if(lbl !=null) { lbl.Text =" Welcome " + Session["username"].ToString().Trim(); } if (lblt != null) { lblt.Text = DateTime.UtcNow.ToLongDateString().ToString(); } //HttpCookie mycookie = Request.Cookies["link"]; if (Session["link"] != null) { //Response.Write(Session["link"].ToString()); Response.Redirect("PropertyViews.aspx"); } else { OpenNewWindow("Remainder.aspx"); } //Lbllastlogin.Text = Session["username"].ToString(); } else { Response.Redirect("Adminlogin.aspx"); } //addlogs(); } } iam calling the javascript function in Page_load ,its working properly ,but the pop window is not displayed.so please some one help me i have specified my total code above thanks in advance

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      saibabuvenkata wrote:

      iam calling the javascript function in Page_load ,its working properly ,but the pop window is not displayed.so please some one help me i have specified my total code above

      Are you using AJAX Scriptmanager in your page?

      cheers, Abhijit CodeProject MVP

      V 1 Reply Last reply
      0
      • V venkata saibabu

        public void OpenNewWindow(string url) { string winFeatures = "toolbar=no,status=no,menubar=no,location=center,scrollbars=no,resizable=no,height=300,width=400"; ClientScript.RegisterStartupScript(this.GetType(),"newWindow", string.Format("window.open('{0}', 'yourWin', '{1}');", url, winFeatures)); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["Admin_Id"] != null) { //Lbladminname.Text = "Hi" + Session["username"].ToString(); // Response.Write(Session["username"].ToString()); //Lbladminname.Text = "Dear" + Session["username"].ToString(); //showlastlogindata(); showlastlogindata(); Label lbl = (Label)Master.FindControl("Lbladminname"); Label lblt = (Label)Master.FindControl("Lbltime"); if(lbl !=null) { lbl.Text =" Welcome " + Session["username"].ToString().Trim(); } if (lblt != null) { lblt.Text = DateTime.UtcNow.ToLongDateString().ToString(); } //HttpCookie mycookie = Request.Cookies["link"]; if (Session["link"] != null) { //Response.Write(Session["link"].ToString()); Response.Redirect("PropertyViews.aspx"); } else { OpenNewWindow("Remainder.aspx"); } //Lbllastlogin.Text = Session["username"].ToString(); } else { Response.Redirect("Adminlogin.aspx"); } //addlogs(); } } iam calling the javascript function in Page_load ,its working properly ,but the pop window is not displayed.so please some one help me i have specified my total code above thanks in advance

        C Offline
        C Offline
        Chetan visodiya
        wrote on last edited by
        #3

        Make sure that browser's "block pop-up windows" option is off.

        1 Reply Last reply
        0
        • V venkata saibabu

          public void OpenNewWindow(string url) { string winFeatures = "toolbar=no,status=no,menubar=no,location=center,scrollbars=no,resizable=no,height=300,width=400"; ClientScript.RegisterStartupScript(this.GetType(),"newWindow", string.Format("window.open('{0}', 'yourWin', '{1}');", url, winFeatures)); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["Admin_Id"] != null) { //Lbladminname.Text = "Hi" + Session["username"].ToString(); // Response.Write(Session["username"].ToString()); //Lbladminname.Text = "Dear" + Session["username"].ToString(); //showlastlogindata(); showlastlogindata(); Label lbl = (Label)Master.FindControl("Lbladminname"); Label lblt = (Label)Master.FindControl("Lbltime"); if(lbl !=null) { lbl.Text =" Welcome " + Session["username"].ToString().Trim(); } if (lblt != null) { lblt.Text = DateTime.UtcNow.ToLongDateString().ToString(); } //HttpCookie mycookie = Request.Cookies["link"]; if (Session["link"] != null) { //Response.Write(Session["link"].ToString()); Response.Redirect("PropertyViews.aspx"); } else { OpenNewWindow("Remainder.aspx"); } //Lbllastlogin.Text = Session["username"].ToString(); } else { Response.Redirect("Adminlogin.aspx"); } //addlogs(); } } iam calling the javascript function in Page_load ,its working properly ,but the pop window is not displayed.so please some one help me i have specified my total code above thanks in advance

          D Offline
          D Offline
          Denis Sabic
          wrote on last edited by
          #4

          Hi, it looks like you are missing some quotation marks. Try this: string.Format(@"<script type=""text/javascript"">window.open('{0}', 'yourWin', '{1}');</script>" If that does not help, check your if-clauses. I tried the code myself and everything worked fine.

          1 Reply Last reply
          0
          • A Abhijit Jana

            saibabuvenkata wrote:

            iam calling the javascript function in Page_load ,its working properly ,but the pop window is not displayed.so please some one help me i have specified my total code above

            Are you using AJAX Scriptmanager in your page?

            cheers, Abhijit CodeProject MVP

            V Offline
            V Offline
            venkata saibabu
            wrote on last edited by
            #5

            i am not using Ajax controls in this particular page

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups