本文整理汇总了VB.NET中System.Web.UI.WebResourceAttribute类的典型用法代码示例。如果您正苦于以下问题:VB.NET WebResourceAttribute类的具体用法?VB.NET WebResourceAttribute怎么用?VB.NET WebResourceAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebResourceAttribute类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: CreateChildControls
' 导入命名空间
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
<Assembly: WebResource("image1.gif", "image/jpeg")>
<Assembly: WebResource("help.htm", "text/html", PerformSubstitution:=True)>
Namespace Samples.AspNet.VB.Controls
Public Class MyCustomControl
Inherits Control
<System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
Protected Overrides Sub CreateChildControls()
' Create a new Image control.
Dim _img As New Image()
_img.ImageUrl = Me.Page.ClientScript.GetWebResourceUrl(GetType(MyCustomControl), "image1.jpg")
Me.Controls.Add(_img)
' Create a new Label control.
Dim _lab As New Label()
_lab.Text = "A composite control using the WebResourceAttribute class."
Me.Controls.Add(_lab)
' Create a new HtmlAnchor control linking to help.htm.
Dim a As HtmlAnchor = New HtmlAnchor()
a.HRef = Me.Page.ClientScript.GetWebResourceUrl(GetType(MyCustomControl), "help.htm")
a.InnerText = "help link"
Me.Controls.Add(New LiteralControl("<br />"))
Me.Controls.Add(a)
End Sub
End Class
End Namespace