本文整理匯總了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