本文整理汇总了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