用C#作asp.net 怎么实现点一下按钮 调出另一个页面?

解决方案 »

  1.   

    从后台向前台输出javascript脚本 
    用javascript的弹出页面(window.open)或弹出对话框都可以
    类似的帖子很多
    提问前自己先搜一下
      

  2.   


    //打开窗口方法
    #region 打开添加/修改窗口
    //参数Url:输入要打开窗口的连接地址,比如说:UserEdit.aspx?LoginID=
    /// <summary>
    /// 打开添加/修改窗口
    /// </summary>
    /// <param name="Url">需要输入的链接</param>
    /// <returns>Javascript</returns>
    public string OpenWin(string Url)
    {
    string s = "";
    s =@"<script language = 'Javascript'>
    function OpenWin(sURL,sWinName) 
    {
    var wopen=window.open(sURL,sWinName, 'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=yes,titlebar=0,alwaysRaised');
    try
    {
    if (screen.width == 800)
    {
    wopen.resizeTo(740, 560);
    wopen.moveTo((screen.width-740)/2, (screen.height-560)/2 - 15);
    }
    if (screen.width == 1024)
    {
    wopen.resizeTo(900, 700);
    wopen.moveTo((screen.width-900)/2, (screen.height-700)/2 - 20);
    }
    }
    catch(e){;}

    try
    {
    wopen.focus();
    }
    catch(e){;}
    }";
    s +="OpenWin('"+Url.ToString()+"',''); </script>";
    return s;
    }
    #endregion
    调用该方法:string s = OpenWin("你要打开的窗口");
    Response.Write(s);
      

  3.   

    Page.RegisterClentScriptBlock("open","<script>window.open('a.aspx')</script>");
      

  4.   

    IamBird(IamBird) 的代码不错哦!!
      

  5.   

    <asp button…… onclick= 'window.open('a.aspx')'……>
      

  6.   

    多谢 IamBird(IamBird),现在是在新的IE中显示的,能不能在以同一个IE中显示呢。
      

  7.   

    如果是页面转向的话:Response.Redirect("index.aspx");
      

  8.   

    很 多的啊,Server.Transerfor也可以