本文整理匯總了VB.NET中System.Web.UI.Page.CreateHtmlTextWriter方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Page.CreateHtmlTextWriter方法的具體用法?VB.NET Page.CreateHtmlTextWriter怎麽用?VB.NET Page.CreateHtmlTextWriter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.UI.Page
的用法示例。
在下文中一共展示了Page.CreateHtmlTextWriter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: New
' 導入命名空間
Imports System.IO
Imports System.Web.UI
Namespace WebPage
Public Class MyPage
Inherits Page
Public Sub New()
MyBase.New()
End Sub
<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
Protected Overrides Function CreateHtmlTextWriter(ByVal writer As TextWriter) As HtmlTextWriter
Return New MyHtmlTextWriter(writer)
End Function 'CreateHtmlTextWriter
<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
' Writes a Font control.
writer.AddAttribute("color", "red")
writer.AddAttribute("size", "6pt")
writer.RenderBeginTag(HtmlTextWriterTag.Font)
writer.Write(("<br>" + "The time on the server:<br> " + System.DateTime.Now.ToLongTimeString()))
writer.RenderEndTag()
End Sub
End Class
Public Class MyHtmlTextWriter
Inherits HtmlTextWriter
Public Sub New(writer As TextWriter)
MyBase.New(writer)
writer.Write("<font color=blue> 'MyHtmlTextWriter' is used for rendering.</font>")
End Sub
End Class
End Namespace 'WebPage