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. Event for a class

Event for a class

Scheduled Pinned Locked Moved ASP.NET
3 Posts 3 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.
  • M Offline
    M Offline
    mehrdadc48
    wrote on last edited by
    #1

    Hi. I have a WebUserControl. It has a Text property ( I've written it ) I need an event in this class (my userControl) that fires by changing the Text Property. I wrote an Event like this in my usercontrol event: Public Event Text_Changed(ByVal sender As Object, ByVal e As EventArgs) and in another class I've written this: AddHandler Text_Changed, AddressOf MyMethod Public Sub MyMethod(ByVal sender As Object, ByVal e As EventArgs) End Sub But I don't know how automatically runs the MyMethod by changing the Text Property of userControl

    Best wishes

    T A 2 Replies Last reply
    0
    • M mehrdadc48

      Hi. I have a WebUserControl. It has a Text property ( I've written it ) I need an event in this class (my userControl) that fires by changing the Text Property. I wrote an Event like this in my usercontrol event: Public Event Text_Changed(ByVal sender As Object, ByVal e As EventArgs) and in another class I've written this: AddHandler Text_Changed, AddressOf MyMethod Public Sub MyMethod(ByVal sender As Object, ByVal e As EventArgs) End Sub But I don't know how automatically runs the MyMethod by changing the Text Property of userControl

      Best wishes

      T Offline
      T Offline
      TylerBrinks
      wrote on last edited by
      #2

      Text_Changed(Me, EventArgs.Empty)

      1 Reply Last reply
      0
      • M mehrdadc48

        Hi. I have a WebUserControl. It has a Text property ( I've written it ) I need an event in this class (my userControl) that fires by changing the Text Property. I wrote an Event like this in my usercontrol event: Public Event Text_Changed(ByVal sender As Object, ByVal e As EventArgs) and in another class I've written this: AddHandler Text_Changed, AddressOf MyMethod Public Sub MyMethod(ByVal sender As Object, ByVal e As EventArgs) End Sub But I don't know how automatically runs the MyMethod by changing the Text Property of userControl

        Best wishes

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        I think the problem with you is the postback thing. Let me remind you, you need to do a postback to generate the serverside event. I think you can make a handler to generate the event. If you want to avoid postback, you can call a custom handler using Javascript and AJAX. Use it to generate server side event. :rose:

        Abhishek Sur

        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