在后台中如何将 Response.Redirect("../ErrorWeb/NoPermission.aspx")中的NoPermission.aspx页面放到iframe中???

解决方案 »

  1.   


    <a href="../ErrorWeb/NoPermission.aspx" target="frameid"></a>
    Response.Redirect没试过
      

  2.   

    protected void Page_Load(object sender, EventArgs e) {
     Button1.Attributes.Add("onclick", "this.form.target='iframeName'"); 
      

  3.   

    后台 一定要用 Response.Redirect这个方法?
    不是的话 就修改 iframe 的src属性么
      

  4.   

    错了你的整个页面都提交了还Redirect什么啊
      

  5.   

    完整的例子
    <%@ Page Language="C#" Debug="true" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
      protected void Button1_Click(object sender, EventArgs e)
      {
        Response.Redirect("http://dotnet.aspx.cc"); 
      }  protected void Page_Load(object sender, EventArgs e)
      {
        Button1.Attributes.Add("onclick", "this.form.target='mxh'"); 
      }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    </head>
    <body>    <form  id="form1" runat="server" method="post">
        
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="跳转测试" />
        
        </form>
        <iframe name="mxh"></iframe>
    </body>
    </html>
      

  6.   

    ClientScript.RegisterStartupScript(GetType(), "", "window.document.getElementById('frameid').src='../ErrorWeb/NoPermission.aspx';", true);
      

  7.   

    在前台中加代码
    <head>
    <base target="youriframename">
    </head>
    后台直接跳转
    response.redirect("yoururl")