[英]ObjectDataSourceControl unable to find Type in imported namespace
I have an aspx page in a ASP.NET 2.0 application using several ObjectDataSources. 我在使用多个ObjectDataSources的ASP.NET 2.0应用程序中有一个aspx页面。 They are all bound to the same class like so:
它们都绑定到同一类,如下所示:
<asp:ObjectDataSource ID="TitleDataSource" runat="server" OnSelecting="TitleDataSource_Selecting" SelectMethod="GetTitle" TypeName="DropDownDataSource"></asp:ObjectDataSource>
This was working fine. 一切正常。 Then I made two changes
然后我做了两个改变
DropDownDataSource
from the app_code
directory to a separate assembly DropDownDataSource
从app_code
目录移动到单独的程序集 com.companyname.ie
, now com.companyname.ie.appname
com.companyname.ie
,现在更改为com.companyname.ie.appname
Now I get a "Type Specified in TypeName of 'TitleDataSource' could not be found" error message when I hit the page. 现在,当我点击页面时,收到“找不到在'TitleDataSource'的TypeName中指定的类型”错误消息。
I can fix this by specifying the fully qualified name of the class in TypeName
. 我可以通过在
TypeName
指定类的完全限定名称来解决此问题。 But adding an
directive with the same namespace does not resolve the error. <%
@import但是,添加具有相同名称空间的
指令不能解决该错误。 <%
@import
I've also tried moving my code back into app_code
to no avail. 我也尝试将我的代码移回
app_code
,但无济于事。
Intellisense picks up the Type without me specifying the namespace. Intellisense在不指定名称空间的情况下选择Type。
Its not a massive problem, but its very annoying. 这不是一个大问题,但非常烦人。 Any suggestions?
有什么建议么?
Specifying the fully qualified name is correct. 指定标准名称是正确的。 Otherwise the runtime will only look in the current assembly.
否则,运行时将仅在当前程序集中查找。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.