Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Username"] != null)
        {
            if (Request.QueryString["SMS"] == "yes")
            {
                Label1.Text = "Message Submitted Successfully";
                //here I want to open new window
            }
            else
            {
                Label1.Text = "";
            }
        }
        else
        {
            Response.Redirect("Login.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("GenSMS.aspx");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        Response.Redirect("SchSMS.aspx");
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        Response.Redirect("AtnSMSD.aspx");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("ResSMS.aspx");
    }
}
Posted

You can't do it by simple redirecting in your code-behind. You need to use JavaScript to call window.open with the appropriate parameters

http://www.javascript-coder.com/window-popup/javascript-window-open.phtm[^]
 
Share this answer
 
Mark's link was not opening for me so went through it.

Have a look here: Window.open Method[^]

There are lots of features about the new window that you can define. Like to show toolbar, fullscreen, location, etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900