一个 aspx 页面 可以有几个Import Namespace ?比如桃源提供的网盘,文档管理等,如果把他作为组件,要二次开发的话,就需要在其中的aspx页面中加自己的内容,那么必须有<% @ Import Namespace="MYDEV" %>,而且%@ Page language="c#" Codebehind="editoffice.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.editoffice" %>,也必须改掉,那么这里面是怎么改比较好?截取一段:<%@ Page language="c#" Codebehind="editoffice.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.editoffice" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
  <title>编辑Office文件</title>
<% @ Import Namespace="Webdisk" %>

解决方案 »

  1.   


    一般是这样。N多个都可以。<%@ Page language="c#" Codebehind="editoffice.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.editoffice" %>
    <% @ Import Namespace="Webdisk" %>
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
      <HEAD>
      <title>编辑Office文件 </title>
      

  2.   

    也就是说可以在这个页面里
    <%@ Page language="c#" Codebehind="Mydata.aspx.cs" AutoEventWireup="True" Inherits="Mydev.data" %> 
    <%@ Page language="c#" Codebehind="editoffice.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.editoffice" %> 
    <% @ Import Namespace="Webdisk" %> 
    <% @ Import Namespace="Mydev" %> 在下面的界面里去组织自己代码
      

  3.   

    <%@ Page language="c#" Codebehind="editoffice.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.editoffice" %> 
    <% @ Import Namespace="Webdisk" %>
    根据需要添加命名空间。没限制
      

  4.   

    命名空间的问题,我知道了,谢谢大家。那么下面这个也可以同时存在吗?感觉是只能有一个!<%@ Page language="c#" Codebehind="Mydata.aspx.cs" AutoEventWireup="True" Inherits="Mydev.data" %> 
    <%@ Page language="c#" Codebehind="editoffice.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.editoffice" %> CodeBehind 是用于指定包含与页关联的类的已编译文件的名称。默认的,如果在 Visual Studio.Net 中创建名为 WebForm1 的 Web 窗体页,对于 C# 则为 WebForm1.aspx.cs。该属性不能在运行时使用。是不是又可以理解为:一个页面只能有一个CodeBehind ?
    那么,如果要在本页面上  新加一些内容,就是不可以的,除非有WebForm1.aspx.cs的源文件。请教各位,如果在没有WebForm1.aspx.cs时,添加WebForm1.aspx新功能,大家都是怎么做的?谢谢
      

  5.   

    Page 指令只能有一个,一个类是不可以继承两个类
      

  6.   

    <%@ Page language="c#" Codebehind="editoffice.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.editoffice" %>运行时,不执行的。应该要通过其他办法来增加页面的功能。aspx页面是视觉元素的集合,功能都被搞进DLL中去了,如果要加点新东西进去(无editoffice.aspx.cs源码)就只能js了
      

  7.   

    请教各位,如果在没有WebForm1.aspx.cs时,添加WebForm1.aspx新功能,大家都是怎么做的?谢谢 
      

  8.   

    请教各位,如果在没有WebForm1.aspx.cs时,添加WebForm1.aspx新功能,大家都是怎么做的?谢谢 
    自己顶