[英]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.