本文整理匯總了VB.NET中System.Web.UI.XhtmlTextWriter.IsValidFormAttribute方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET XhtmlTextWriter.IsValidFormAttribute方法的具體用法?VB.NET XhtmlTextWriter.IsValidFormAttribute怎麽用?VB.NET XhtmlTextWriter.IsValidFormAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.UI.XhtmlTextWriter
的用法示例。
在下文中一共展示了XhtmlTextWriter.IsValidFormAttribute方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Render
' Override the Render method.
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
' Create an instance of the XhtmlTextWriter class,
' named w, and cast the HtmlTextWriter passed
' in the writer parameter to w.
Dim w As XhtmlTextWriter = New XhtmlTextWriter(writer)
' Create a string variable, named value, to hold
' the control's Text property value.
Dim value As String = Control.Text
' Create a Boolean variable, named attTest,
' to test whether the Style attribute is
' valid in the page that the control is
' rendered to.
Dim attTest As Boolean = w.IsValidFormAttribute("style")
' Check whether attTest is true or false.
' If true, a style is applied to the XHTML
' content. If false, no style is applied.
If (attTest = True) Then
w.EnterStyle(Control.ControlStyle)
End If
' Write the Text property value of the control,
' a <br> element, and a string. Consider encoding the value using WriteEncodedText.
w.Write(value)
w.WriteBreak()
w.Write("This control conditionally rendered its styles for XHTML.")
' Check whether attTest is true or false.
' If true, the XHTML style is closed.
' If false, nothing is rendered.
If (attTest = True) Then
w.ExitStyle(Control.ControlStyle)
End If
End Sub