本文整理汇总了VB.NET中System.Web.UI.DataBindingHandlerAttribute.DataBindingHandlerAttribute构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET DataBindingHandlerAttribute构造函数的具体用法?VB.NET DataBindingHandlerAttribute怎么用?VB.NET DataBindingHandlerAttribute使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。您也可以进一步了解该构造函数所在类System.Web.UI.DataBindingHandlerAttribute
的用法示例。
在下文中一共展示了DataBindingHandlerAttribute构造函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Render
' The following example uses the Default
' DataBindingHandlerAttribute constructor.
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Security.Permissions
Namespace MyTextCustomControl
<DataBindingHandlerAttribute()> _
<AspNetHostingPermission(SecurityAction.Demand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class MyTextBox
Inherits TextBox
Protected Overrides Sub Render(output As HtmlTextWriter)
output.Write("This class uses the DataBindingHandlerAttribute class.")
End Sub
End Class
End Namespace 'MyTextCustomControl
示例2: Render
' The following example uses the
' DataBindingHandlerAttribute(String) constructor to designate
' the custom DataBindingHandler class, named MyDataBindingHandler,
' for the custom MyWebControl class.
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.Design
Imports System.ComponentModel.Design
Imports System.Security.Permissions
Namespace MyTextCustomControl
<DataBindingHandlerAttribute("MyTextCustomControl.MyDataBindingHandler")> _
<AspNetHostingPermission(SecurityAction.Demand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class MyWebControl
Inherits WebControl
Protected Overrides Sub Render(output As HtmlTextWriter)
output.Write("This class uses the DataBindingHandlerAttribute class.")
End Sub
End Class
Public Class MyDataBindingHandler
Inherits TextDataBindingHandler
Public Overrides Sub DataBindControl(host As IDesignerHost, myControl As Control)
CType(myControl, TextBox).Text = "Added by MyDataBindingHandler"
End Sub
End Class
End Namespace 'MyTextCustomControl
示例3: New
Namespace CustomControls
<DataBindingHandler(GetType(MyDataBindingHandler)), ToolboxData("<{0}:MyLabel runat=server></{0}:MyLabel>")> _
Public Class MyLabel
Inherits Label
Public Sub New()
'Insert your code here.
End Sub
End Class
Public Class MyDataBindingHandler
Inherits DataBindingHandler
Public Overrides Sub DataBindControl(host As IDesignerHost, control As Control)
CType(control, Label).Text = "Added by data binding handler."
End Sub
End Class
End Namespace 'CustomControls