Wael Salman
What is delegation ?? Can you give clear examples, and how can we define and use user-defined delegations?? What is teh combine and remove methods??
By Wael Salman in ASP.NET on Dec 14 2008
  • Nandini
    Dec, 2008 29

    += means you are defining a delegate for your function.

    suppose your function is hello()

    you want to call the function when user clicks on submit.

    In simple words you are telling the button call the function when you are clicked. :)

    • 0
  • Wael Salman
    Dec, 2008 23

    Thank you

     

    and what is submitButton.click += ....  what is += means exactly in this situation?? how can you write it in simple way??

    • 0
  • Nandini
    Dec, 2008 23

    Delegations

    Delegate is very simple it is pointer to your function.In simple words you can say you are invoking or calling your function.

    Suppose you have your userdefined function you want to call it at some point at a particular point of time you can use your delegate there.

    suppose if you want to define a delegate for a submit button you can define as

    btnSubmit.Click += newEventHandler(btnSubmit_Click);

    you can write the definition of btnSubmit_Click later

    • 0
  • Muhammad Asad Khan
    Dec, 2008 20

    Delegation is the simple yet powerful concept of handing a task over to another part of the program. In object-oriented programming it is used to describe the situation wherein one object defers a task to another object, known as the delegate. This mechanism is sometimes referred to as aggregation, consultation or forwarding

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS