How to raiseEvent of ITemplate interface
-
Hello Everybody, I need help from all of u, pls help me for following code. I have given number for each line, only for ref. When u copy the code, pls remove the numbers given and do modification. The original code is in C# that converted into VB.net using converter.This code is perfectly working in C# without any error and waring Now I'm facing problem. Now problem is, the line number 20 need raiseEvent, I don't know how to raise event in vb.net Pls concentrate on line 20. Pls let me know how to declare and raise event. 1 Public Class CreateItemTemplateRadioButton 2 Implements ITemplate 3 Dim strText As String 4 Dim strRadioButtonName As String 5 Dim Visibility As Boolean = True 6 Dim blChecked As Boolean = False 7 Public Sub New(ByVal RadioButtonName As String, ByVal Text As String, ByVal AutoCheck As Boolean) 8 Me.strText = Text 9 Me.strRadioButtonName = RadioButtonName 10 Me.blChecked = AutoCheck 11 End Sub 12 Public Sub New(ByVal RadioButtonName As String, ByVal Text As String, ByVal AutoCheck As Boolean, ByVal Visibility As Boolean) 13 Me.strText = Text 14 Me.strRadioButtonName = RadioButtonName 15 Me.Visibility = Visibility 16 Me.blChecked = AutoCheck 17 End Sub 18 Public Sub InstantiateIn(ByVal objcontainer As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn 19 Dim rad As HtmlInputRadioButton = New HtmlInputRadioButton 20 rad.DataBinding += New EventHandler(rad_DataBinding) 21 objContainer.Controls.Add(rad) 22 End Sub 23 Private Sub rad_DataBinding(ByVal sender As Object, ByVal e As EventArgs) 24 Dim rad As HtmlInputRadioButton = CType(sender, HtmlInputRadioButton) 25 rad.Value = strText 26 rad.Checked = blChecked 27 rad.Visible = Visibility 28 End Sub 29 End Class Balasaheb Software Developer Platform: Asp.net,vb.net Database: SQL Server 2000
-
Hello Everybody, I need help from all of u, pls help me for following code. I have given number for each line, only for ref. When u copy the code, pls remove the numbers given and do modification. The original code is in C# that converted into VB.net using converter.This code is perfectly working in C# without any error and waring Now I'm facing problem. Now problem is, the line number 20 need raiseEvent, I don't know how to raise event in vb.net Pls concentrate on line 20. Pls let me know how to declare and raise event. 1 Public Class CreateItemTemplateRadioButton 2 Implements ITemplate 3 Dim strText As String 4 Dim strRadioButtonName As String 5 Dim Visibility As Boolean = True 6 Dim blChecked As Boolean = False 7 Public Sub New(ByVal RadioButtonName As String, ByVal Text As String, ByVal AutoCheck As Boolean) 8 Me.strText = Text 9 Me.strRadioButtonName = RadioButtonName 10 Me.blChecked = AutoCheck 11 End Sub 12 Public Sub New(ByVal RadioButtonName As String, ByVal Text As String, ByVal AutoCheck As Boolean, ByVal Visibility As Boolean) 13 Me.strText = Text 14 Me.strRadioButtonName = RadioButtonName 15 Me.Visibility = Visibility 16 Me.blChecked = AutoCheck 17 End Sub 18 Public Sub InstantiateIn(ByVal objcontainer As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn 19 Dim rad As HtmlInputRadioButton = New HtmlInputRadioButton 20 rad.DataBinding += New EventHandler(rad_DataBinding) 21 objContainer.Controls.Add(rad) 22 End Sub 23 Private Sub rad_DataBinding(ByVal sender As Object, ByVal e As EventArgs) 24 Dim rad As HtmlInputRadioButton = CType(sender, HtmlInputRadioButton) 25 rad.Value = strText 26 rad.Checked = blChecked 27 rad.Visible = Visibility 28 End Sub 29 End Class Balasaheb Software Developer Platform: Asp.net,vb.net Database: SQL Server 2000
Something looks like:
AddHandler rad.DataBinding, AddressOf rad_DataBinding
How to: Dynamically Bind Event Handlers at Run Time in ASP.NET Web Pages [^] AddHandler Statement [^]
-
Something looks like:
AddHandler rad.DataBinding, AddressOf rad_DataBinding
How to: Dynamically Bind Event Handlers at Run Time in ASP.NET Web Pages [^] AddHandler Statement [^]