本文整理匯總了VB.NET中System.Web.UI.Design.WebControls.DataListDesigner.GetDesignTimeHtml方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET DataListDesigner.GetDesignTimeHtml方法的具體用法?VB.NET DataListDesigner.GetDesignTimeHtml怎麽用?VB.NET DataListDesigner.GetDesignTimeHtml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.UI.Design.WebControls.DataListDesigner
的用法示例。
在下文中一共展示了DataListDesigner.GetDesignTimeHtml方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: GetDesignTimeHtml
Public Overrides Function GetDesignTimeHtml() As String
Dim designTimeHtml As String = String.Empty
simpleGView = CType(Component, SimpleGridView)
' Check the control's BorderStyle property to
' conditionally render design-time HTML.
If (simpleGView.BorderStyle = BorderStyle.NotSet) Then
' Save the current property settings in variables.
Dim oldCellPadding As Integer = simpleGView.CellPadding
Dim oldBorderWidth As Unit = simpleGView.BorderWidth
Dim oldBorderColor As Color = simpleGView.BorderColor
' Set properties and generate the design-time HTML.
Try
simpleGView.Caption = "SimpleGridView"
simpleGView.CellPadding = 1
simpleGView.BorderWidth = Unit.Pixel(3)
simpleGView.BorderColor = Color.Red
designTimeHtml = MyBase.GetDesignTimeHtml()
Catch ex As Exception
' Get HTML from the GetErrorDesignTimeHtml
' method if an exception occurs.
designTimeHtml = GetErrorDesignTimeHtml(ex)
' Return the properties to their original values.
Finally
simpleGView.CellPadding = oldCellPadding
simpleGView.BorderWidth = oldBorderWidth
simpleGView.BorderColor = oldBorderColor
End Try
Else
designTimeHtml = MyBase.GetDesignTimeHtml()
End If
Return designTimeHtml
End Function
Protected Overrides Function _
GetErrorDesignTimeHtml(ByVal exc As Exception) As String
Return CreatePlaceHolderDesignTimeHtml( _
"ASPNET.Examples: An error occurred while rendering the GridView.")
End Function
開發者ID:VB.NET開發者,項目名稱:System.Web.UI.Design.WebControls,代碼行數:48,代碼來源:DataListDesigner.GetDesignTimeHtml