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 Handling

Event Handling

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netquestionlearning
7 Posts 4 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.
  • S Offline
    S Offline
    SPanicker
    wrote on last edited by
    #1

    Hi, Am just learning ASP.NET can u tell me wats the difference if the first parameter in a event handler is source or sender? Tht is, if it is EventHandler1(object source, EventArgs e) or EventHandler2(object sender, EventArgs e). What does that actually signify?:confused: Regards, Sriraj.

    P B 2 Replies Last reply
    0
    • S SPanicker

      Hi, Am just learning ASP.NET can u tell me wats the difference if the first parameter in a event handler is source or sender? Tht is, if it is EventHandler1(object source, EventArgs e) or EventHandler2(object sender, EventArgs e). What does that actually signify?:confused: Regards, Sriraj.

      P Offline
      P Offline
      PSK_
      wrote on last edited by
      #2

      Sender signifies the object raising the event. If you click on a button then sender will be button object.

      Regards, Prakash Kalakoti

      S 1 Reply Last reply
      0
      • P PSK_

        Sender signifies the object raising the event. If you click on a button then sender will be button object.

        Regards, Prakash Kalakoti

        S Offline
        S Offline
        SPanicker
        wrote on last edited by
        #3

        Thanks Prakash. but one more small clarification I need then sometimes I have seen that, this is replaced with Source. Tht is (Object Source, ...) Wat does tht mean? source is being used in which context? :)

        Regards, Sriraj.

        S 1 Reply Last reply
        0
        • S SPanicker

          Thanks Prakash. but one more small clarification I need then sometimes I have seen that, this is replaced with Source. Tht is (Object Source, ...) Wat does tht mean? source is being used in which context? :)

          Regards, Sriraj.

          S Offline
          S Offline
          sulabh2020
          wrote on last edited by
          #4

          See look only over upon the type of argument that supplied to function. Source is the only variable that is of type object so it doesnt matter whether it is sender or source, the logic is same

          Hello Forum Always be in touch to help about the topic ASP.NET

          S 1 Reply Last reply
          0
          • S SPanicker

            Hi, Am just learning ASP.NET can u tell me wats the difference if the first parameter in a event handler is source or sender? Tht is, if it is EventHandler1(object source, EventArgs e) or EventHandler2(object sender, EventArgs e). What does that actually signify?:confused: Regards, Sriraj.

            B Offline
            B Offline
            badgrs
            wrote on last edited by
            #5

            As far as I'm aware they're the same thing, just two different conventions for naming the variable....typical of MS to not stick to their own naming conventions :wtf:. Remember, the name of the variable doesn't matter, basically it will always reference the control that fired the event (sometimes it might be null but not sure why)

            S 1 Reply Last reply
            0
            • S sulabh2020

              See look only over upon the type of argument that supplied to function. Source is the only variable that is of type object so it doesnt matter whether it is sender or source, the logic is same

              Hello Forum Always be in touch to help about the topic ASP.NET

              S Offline
              S Offline
              SPanicker
              wrote on last edited by
              #6

              Ok. so u mean its both one nd d same? Thnx.

              Regards, Sriraj.

              1 Reply Last reply
              0
              • B badgrs

                As far as I'm aware they're the same thing, just two different conventions for naming the variable....typical of MS to not stick to their own naming conventions :wtf:. Remember, the name of the variable doesn't matter, basically it will always reference the control that fired the event (sometimes it might be null but not sure why)

                S Offline
                S Offline
                SPanicker
                wrote on last edited by
                #7

                Hi badgrs, thnx. fr d clarification.

                Regards, Sriraj.

                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