您的位置:程序门 -> .net技术 -> c#



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


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


命名空间的使用问题(急)--问题解决,立马揭帖[已结贴,结贴人:xu8512]
发表于:2007-03-12 20: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).

发表于:2007-03-12 20:30:571楼 得分:0
是不是需要添加引用阿?
发表于:2007-03-12 20:32:492楼 得分:0
不知道怎么添加,谁可以指明下,直接贴代码,不要讲理论
发表于:2007-03-12 20:33:463楼 得分:0
这个类system.web.ui.page只能由友元类继承?
发表于:2007-03-12 20:36:284楼 得分:0
问题是我不知道怎么来添加一个命名空间,如我在上面代码的添加,就出问题,没命名空间就没问题,这是怎么回事
发表于:2007-03-12 20:40:305楼 得分:0
问题的关键是有继承关系呢.

这个问题就是由于system.web.ui.page类肯定有特殊规定.我没弄过asp.net,不太清楚.

顶lz吧
发表于:2007-03-12 20:41:306楼 得分:0
我看到了partial,   问一下楼主,你在页面设计页内也加了这个命名空间吗?应该加上.
发表于:2007-03-12 20:45:567楼 得分:40
<%@   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 "   %>
发表于:2007-03-12 20:47:088楼 得分:0
关键在于怎么加?
谁告诉我100分全是他的
发表于:2007-03-12 20:48:059楼 得分:40
靠...

  <%@   page   language= "c# "   autoeventwireup= "true "   codefile= "test.aspx.cs "   inherits= "edge.projects.intel._test.members_test "   %>
发表于:2007-03-12 20:48:3010楼 得分:0
楼上答案错误
发表于:2007-03-12 20:48:4311楼 得分:0
兄弟们是不是做.net开发的~~
发表于:2007-03-12 20:49:1812楼 得分:0
错了你找我
发表于:2007-03-12 20:49:5213楼 得分:0
揭帖,楼上两位各50分
发表于:2007-03-12 20:50:0814楼 得分:20
try..

inherits= "members_test

-> >

inherits= "edge.projects.intel._test.members_test
发表于:2007-03-12 20:50:4315楼 得分:0
似乎来晚了...

...
发表于:2007-03-12 20:51:5016楼 得分:0


一百分啊,泪~


快速检索

最新资讯
热门点击