[英]ASP.Net/VB.Net/LINQ: Unable to cast object of type .objectquery to type generic.list
[英]Alias Generic Type With ASP.Net Import Directive in VB.Net Page
我似乎无法在设置为“ vb”语言的ASP.Net页面上导入通用类型:
<%@ Page Language="vb" %>
<%-- This works fine. --%>
<%@ Import Namespace="MyString=System.String" %>
<%-- This gives an error. --%>
<%@ Import Namespace="MyList=System.Collections.Generic.List(Of System.String)" %>
<%-- Error: "The 'namespace' attribute cannot contain spaces." --%>
请注意,我对这些替代方案不感兴趣(由于您不关心的无聊原因):
是否可以在VB.Net ASP.Net页面上为通用类型添加别名,或者这是Microsoft的疏忽?
是的,坏消息:
List<System.String>
,因此不会引发错误。 他们再次省略了VB。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.