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