>>>>I'm looking at an ASP.Net book, and the author show's 3 ways to define the event that occurs when a Submit button is clicked:
>>>>
>>>>1). Double click the button in the designer
>>>>
>>>>2). Use the onserverclick="Convert_ServerClick" syntax in the control's tag
>>>>
>>>>3). Use the MyButton.ServerClick += this.Some_Handler;
>>>>
>>>>Is there a preffered method?
>>>
>>>IMHO, the first method is the easiest.
>>
>>When I dblclick the button, VS created a javascript function in the page. The other two ways create C# code. I'm confused.
>
>Very weird. When you double click on a control in VS it automatically adds the server's code, for the button it should be Button_Click event.
Depends on whether Kevin is referring to the asp:Button or the HTML Input (Button)
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement