本文整理匯總了VB.NET中System.Web.DynamicData.MetaModel類的典型用法代碼示例。如果您正苦於以下問題:VB.NET MetaModel類的具體用法?VB.NET MetaModel怎麽用?VB.NET MetaModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了MetaModel類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1:
' 導入命名空間
Imports System.Web.DynamicData
Imports System.ComponentModel.DataAnnotations
Imports System.ComponentModel
<MetadataType(GetType(ProductMetaData))> _
Partial Public Class Product
End Class
Public Class ProductMetaData
End Class
示例2: GetModel
' 導入命名空間
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Xml.Linq
Imports System.Web.DynamicData
Partial Public Class PathModel
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
DynamicDataManager1.RegisterControl(GridDataSource1)
End Sub
' Get the data model.
Public Function GetModel(ByVal defaultModel As Boolean) As MetaModel
Dim model As MetaModel
If defaultModel Then
model = MetaModel.[Default]
Else
model = MetaModel.GetModel(GetType(AdventureWorksLTDataContext))
End If
Return model
End Function
' Get the registered action path.
Public Function EvaluateActionPath() As String
Dim tableName As String = LinqDataSource1.TableName
Dim model As MetaModel = GetModel(False)
Dim actionPath As String = model.GetActionPath(tableName, System.Web.DynamicData.PageAction.List, GetDataItem())
Return actionPath
End Function
End Class