new 完之后的page的类
怎么弹出来?redirect这会不行了

解决方案 »

  1.   

    // WebForm1.aspx.cs and Default.aspx.cs is below//WebForm1.aspx.cspublic class WebForm1 : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.Label Label1;
    protected System.Web.UI.WebControls.TextBox TextBox1;
    protected System.Web.UI.WebControls.Button Button1;

    private void Page_Load(object sender, System.EventArgs e)
    {
    // Put user code to initialize the page here
    }
    #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {    
    this.Button1.Click += new System.EventHandler(this.Button1_Click);
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion private void Button1_Click(object sender, System.EventArgs e)
    {

    }
    }//////////////////////////////////////////////////////////////////////////////
    //Default.aspx.cs private void Button1_Click(object sender, System.EventArgs e)
    {
    WebForm1 wf = new WebForm1();
                                // then do what????????????????????
                                // ?????????????????
    }
      

  2.   

    a.aspx.cs中:
     Page.RegisterStartupScript("script", "<script>window.open('b.aspx');</script>")
      

  3.   

    这个是后台的你在前台必须有一个WebForm1与之对应的
    <%@ Page Buffer ="false" language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="*****.WebFom1" %>
    *****//为你的工程名或者是解决方案的名称
      

  4.   

    你开始向工程中添加一个页面如1。aspx
    然后调用Response。redirect("1。aspx");
    就行了阿
      

  5.   

    回复一下各位大侠,我本来有 aspx 和 aspx.cs,现在aspx文件没有了,只有cs文件,现在还能弹出来叶面吗?   就是说反推行不行的?
      

  6.   

    没有前台代码,光有后台代码,你说这个还能行吗?当然,如果你这个页面只是那种希望作为一个过渡中间页面,不需要在前台显示任何东西,只是单纯的作为一个跳转到其他页面的.aspx页面,你可以添加一个空的只包含<%@ Page Buffer ="false" language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="*****.WebFom1" %>指令的.aspx页面,不过前提是你在其他页面必须有跳转到这个页面的控件或者脚本命令,至于页面跳转的方式有很多,最常见的就是Response.Redirect("要跳转的页面"),除了少数情况,这个指令基本上都能够实现页面跳转