命名空间的使用问题(急)--问题解决,立马揭帖

xu8512 2007-03-12 08:23:35
就一个页面,什么都没有,我自己添加一个命名空间的话就出问题
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace EDGE.Projects.Intel._test//问题所在
{
public partial class Members_test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
}
--------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Members_test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>
------------------------------
出现问题:ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

...全文
240 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
csShooter 2007-03-12
  • 打赏
  • 举报
回复


一百分啊,泪~
liujia_0421 2007-03-12
  • 打赏
  • 举报
回复
似乎来晚了...

...
liujia_0421 2007-03-12
  • 打赏
  • 举报
回复
try..

Inherits="Members_test

->>

Inherits="EDGE.Projects.Intel._test.Members_test
xu8512 2007-03-12
  • 打赏
  • 举报
回复
揭帖,楼上两位各50分
csShooter 2007-03-12
  • 打赏
  • 举报
回复
错了你找我
csShooter 2007-03-12
  • 打赏
  • 举报
回复
兄弟们是不是做.net开发的~~
xu8512 2007-03-12
  • 打赏
  • 举报
回复
楼上答案错误
csShooter 2007-03-12
  • 打赏
  • 举报
回复
靠...

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="EDGE.Projects.Intel._test.Members_test" %>
xu8512 2007-03-12
  • 打赏
  • 举报
回复
关键在于怎么加?
谁告诉我100分全是他的
aihui109 2007-03-12
  • 打赏
  • 举报
回复
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Members_test" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="EDGE.Projects.Intel._test.Members_test" %>
sunrobust 2007-03-12
  • 打赏
  • 举报
回复
我看到了partial, 问一下楼主,你在页面设计页内也加了这个命名空间吗?应该加上.
sunrobust 2007-03-12
  • 打赏
  • 举报
回复
问题的关键是有继承关系呢.

这个问题就是由于System.Web.UI.Page类肯定有特殊规定.我没弄过ASP.NET,不太清楚.

顶lz吧
xu8512 2007-03-12
  • 打赏
  • 举报
回复
问题是我不知道怎么来添加一个命名空间,如我在上面代码的添加,就出问题,没命名空间就没问题,这是怎么回事
sunrobust 2007-03-12
  • 打赏
  • 举报
回复
这个类System.Web.UI.Page只能由友元类继承?
xu8512 2007-03-12
  • 打赏
  • 举报
回复
不知道怎么添加,谁可以指明下,直接贴代码,不要讲理论
OceanLee 2007-03-12
  • 打赏
  • 举报
回复
是不是需要添加引用阿?

110,546

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧