分析器错误消息: “Responsedirect.WebForm1”不扩展类“System.Web.UI.Page”,因此此处不允许。源错误: 
行 1:  <%@ Page Language ="C#" Codebehind ="WebForm1.aspx.cs" 
行 2:  AutoEventWireup="false" Inherits="Responsedirect.WebForm1" %>
行 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 源文件: /WebForm1.aspx    行: 1 

解决方案 »

  1.   

    Inherits
    是指你class的名字
    比如你的.cs文件里面的class 是_default Inherits="_Default"
    public partial class _Default : System.Web.UI.Page
    {
      

  2.   

    看看WebForm1.aspx里面的WebForm1.cs文件里面的class的名字。
    把你的改成class名字就可以了
    <%@ Page Language ="C#" Codebehind ="WebForm1.aspx.cs"  
    行 2:  AutoEventWireup="false" Inherits="Responsedirect.WebForm1" %> 
    行 3:   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      

  3.   

    行 1:   <%@ Page Language ="C#" Codebehind ="WebForm1.aspx.cs"  
    行 2:  AutoEventWireup="false" Inherits="WebForm1" %> 
    行 3:   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      

  4.   

    把Inherits="Responsedirect.WebForm1"改成和服务端文件的类名一样试试.
      

  5.   

    还是不得 不知道为什么 帮我看下代码 好吗  还是上面的错误提示,郁闷!!!!!!!!!.aspx文件内容
    <%@ Page Language="C#" AutoEventWireup="false" CodeBehind="WebForm1.aspx.cs" 
    Inherits="ResponseRedirect.WebForm1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <title>WebForm1</title>
    </head>
    <body ms_positioning="gridlayout">
    <form id="Form1" method="post" runat="server">
    请输入要访问的网址:<asp:TextBox ID="TextBox1" runat="server"
    width="368px" ></asp:TextBox> 
    <p></p>
    <asp:Button ID="Button1" runat="server" Text = "访问" ></asp:Button></form>
    </body>
    </html>.cs文件内容namespace WebApplication5
    {
        public  class WebForm1 : System.Web.UI.Page
        {
            protected System.Web.UI.WebControls.Button Button1;
            protected System.Web.UI.WebControls.TextBox TextBox1;
            protected void Page_Load(object sender, EventArgs e)
            {        }
            private void Button1_Click(object sender, System.EventArgs e)
            {
                if((TextBox1.Text != "") &&
            (TextBox1.Text.IndexOf("http://")>=0))
        {
                    //如果目标网址不为空,并包含“http://”字符,则跳转
                    Response.Redirect(TextBox1.Text);
        }    }
        }
    }
      

  6.   

    <%@ Page Language="C#" AutoEventWireup="false" CodeBehind="WebForm1.aspx.cs"  
    Inherits="WebForm1" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html> 
    <head> 
    <title>WebForm1 </title> 
    </head> 
    <body ms_positioning="gridlayout"> 
    <form id="Form1" method="post" runat="server"> 
    请输入要访问的网址: <asp:TextBox ID="TextBox1" runat="server" 
    width="368px" > </asp:TextBox>  
    <p> </p> 
    <asp:Button ID="Button1" runat="server" Text = "访问" > </asp:Button> 
    </form> 
    </body> 
    </html> .cs文件内容 namespace WebApplication5 

        public partial class WebForm1 : System.Web.UI.Page 
        { 
            protected System.Web.UI.WebControls.Button Button1; 
            protected System.Web.UI.WebControls.TextBox TextBox1; 
            protected void Page_Load(object sender, EventArgs e) 
            {         } 
            private void Button1_Click(object sender, System.EventArgs e) 
            { 
                if((TextBox1.Text != "") && 
            (TextBox1.Text.IndexOf("http://")>=0)) 
        { 
                    //如果目标网址不为空,并包含“http://”字符,则跳转 
                    Response.Redirect(TextBox1.Text); 
        }     } 
        } 
    }
      

  7.   

    <%@ Page Language="C#" AutoEventWireup="false" CodeBehind="WebForm1.aspx.cs"  
    Inherits="ResponseRedirect.WebForm1" %> 
    改成
    <%@ Page Language="C#" AutoEventWireup="false" CodeBehind="WebForm1.aspx.cs"  
    Inherits="WebApplication5.WebForm1" %> 
    试试
      

  8.   

    程序的功能? 靠Inherits="ResponseRedirect.WebForm1"实现的功能??
      

  9.   

    已解决:
        检查页面的命名空间和class的命名空间是不是一样,确保相同就OK了
      

  10.   

    找到答案了,Inherits的内容写成 namesapce.class 形式就可以了