Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.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
C# 将第三方控制器添加到aspx_C#_Asp.net_Visual Studio 2012 - Fatal编程技术网

C# 将第三方控制器添加到aspx

C# 将第三方控制器添加到aspx,c#,asp.net,visual-studio-2012,C#,Asp.net,Visual Studio 2012,我想将第三方控制器添加到我的aspx 我下载并安装它。然后我将dll文件编译到我的bin中,并将这些dll添加到我的引用中。我可以在我的aspx页面中看到控制器,但我无法在我的c代码中使用它们 我确信我在web.config中做错了什么 这是我所有的web.config <?xml version="1.0"?> <!-- For more information on how to configure your ASP.NET application, please v

我想将第三方控制器添加到我的aspx

我下载并安装它。然后我将dll文件编译到我的bin中,并将这些dll添加到我的引用中。我可以在我的aspx页面中看到控制器,但我无法在我的c代码中使用它们

我确信我在web.config中做错了什么 这是我所有的web.config

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
      <pages>
        <controls>
             <add tagPrefix="ew"  namespace="eWorld.UI.Compatibility" assembly="eWorld.UI.Compatibility"/>
        </controls>
      </pages>

    </system.web>
</configuration>
因为我犯了这个错误:

Error   1   The name 'CldrSchCallBack' does not exist in the current context    C:\Users\User\documents\visual studio 2012\Projects\TestC1\TestC1\CallInfo.aspx.cs  537 120 TestC1
Error   2   The name 'TimePicker1' does not exist in the current context    C:\Users\User\documents\visual studio 2012\Projects\TestC1\TestC1\CallInfo.aspx.cs  537 162 TestC1

我已经在我的机器上测试了这个控件,首先我下载了版本2.0.6,然后引用了两个dll:eWorld.UI.Compatibility.dll和eWorld.UI.dll

然后我修改了web.config文件,如下所示:

  <configuration>
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
      <assemblies>
        <add assembly="eWorld.UI.Compatibility, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24D65337282035F2"/>
        <add assembly="eWorld.UI, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24D65337282035F2"/>
      </assemblies>    
    </compilation>        
    <pages>
            <controls>
              <add tagPrefix="ew"  namespace="eWorld.UI.Compatibility" assembly="eWorld.UI.Compatibility"/>
            </controls>
          </pages>
  </system.web>
</configuration>

另一种方法可能是在aspx页面顶部添加以下内容:

<%@ Register Assembly="eWorld.UI, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>

当然,您应该将版本号更改为您正在使用的版本。尝试一下,最好发布更多的aspx页面标记,这将有助于更快地找到解决方案

  <configuration>
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
      <assemblies>
        <add assembly="eWorld.UI.Compatibility, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24D65337282035F2"/>
        <add assembly="eWorld.UI, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24D65337282035F2"/>
      </assemblies>    
    </compilation>        
    <pages>
            <controls>
              <add tagPrefix="ew"  namespace="eWorld.UI.Compatibility" assembly="eWorld.UI.Compatibility"/>
            </controls>
          </pages>
  </system.web>
</configuration>
<%@ Register Assembly="eWorld.UI, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>