Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 如何在MVC.NET视图中从库继承_Asp.net Mvc_Ckfinder - Fatal编程技术网

Asp.net mvc 如何在MVC.NET视图中从库继承

Asp.net mvc 如何在MVC.NET视图中从库继承,asp.net-mvc,ckfinder,Asp.net Mvc,Ckfinder,我试图在我的MVC.Net网站中实现CKFinder,但是默认设置仅适用于常规asp.Net网站,因此我尝试将其更改为正常 一页从库CKFinder.Connector.Connector继承。在过去,我的aspx只能继承CKFinder.Connector.Connector,但是在MVC.NET中是如何做到的呢 Inherits=“System.Web.Mvc.ViewPage”是否相同?Inherits=“System.Web.Mvc.ViewPage”会将CKFinder.Connect

我试图在我的MVC.Net网站中实现CKFinder,但是默认设置仅适用于常规asp.Net网站,因此我尝试将其更改为正常

一页从库CKFinder.Connector.Connector继承。在过去,我的aspx只能继承CKFinder.Connector.Connector,但是在MVC.NET中是如何做到的呢

Inherits=“System.Web.Mvc.ViewPage”
是否相同?

Inherits=“System.Web.Mvc.ViewPage”
会将CKFinder.Connector.Connector设置为视图页面的强类型模型对象。如果您试图使用
语法访问标记中的连接器实例的属性,这将对您有效

相反,如果需要引用CKFinder.Connector.Connector作为命名空间,则需要在页面指令下方和任何标记之前添加以下行:

<%@ Import Namespace="CKFinder.Connector.Connector" %>

Inherits=“System.Web.Mvc.ViewPage”
会将CKFinder.Connector.Connector设置为视图页面的强类型模型对象。如果您试图使用
语法访问标记中的连接器实例的属性,这将对您有效

相反,如果需要引用CKFinder.Connector.Connector作为命名空间,则需要在页面指令下方和任何标记之前添加以下行:

<%@ Import Namespace="CKFinder.Connector.Connector" %>


< /代码> 如果频繁使用这个命名空间,您应该考虑将其添加到<代码> VIEWS/Web.CONFIG文件中的命名空间节点。

这确保所有页面都可以访问此命名空间,并且intellisense也将可用。这一点也在本文中进行了讨论

XML结构如下所示

<configuration>
  <system.web>
    <pages>
      <namespaces>
        <add namespace="CKFinder.Connector.Connector" /> <!-- <<< Your entry here  -->
      </namespaces>
    </pages>  
  </system.web>
</configuration>


<> > <代码>命名空间< /代码>节点可能不存在,因此您应该在<代码>页< /COD>节点(应该存在)内添加它。

如果频繁使用此命名空间,则应该考虑将其添加到文件>中的命名空间节点。

这确保所有页面都可以访问此命名空间,并且intellisense也将可用。这一点也在本文中进行了讨论

XML结构如下所示

<configuration>
  <system.web>
    <pages>
      <namespaces>
        <add namespace="CKFinder.Connector.Connector" /> <!-- <<< Your entry here  -->
      </namespaces>
    </pages>  
  </system.web>
</configuration>

名称空间
节点可能不存在,因此您应该将其添加到
页面
节点(应该存在)中