Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to raiseEvent of ITemplate interface

How to raiseEvent of ITemplate interface

Scheduled Pinned Locked Moved ASP.NET
helpcsharpdatabaseasp-net
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BalasahebK
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • B BalasahebK

      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

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      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 [^]

      B 1 Reply Last reply
      0
      • M minhpc_bk

        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 [^]

        B Offline
        B Offline
        BalasahebK
        wrote on last edited by
        #3

        Thanks for ur help, I have tried for the whole day, finally I got answer from my collegue last evening. So now its working fine. Thanks for also ur help. Keep in touch Balasaheb Software Developer Platform: Asp.net,vb.net Database: SQL Server 2000

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups