Learn Event Handling in ASP.NET through .NET Training

Page 1

Learn Event Handling in ASP.NET through .NET Training Summary: Event handling is one of the most important concepts in the ASP.NET programming. Every control like button, check box etc., will trigger events in ASP that are handled by event handler methods that have a piece of code to execute when called. ************************************************** Article: ASP.NET is one of the most popular programming languages used for the development of websites and applications. These websites or applications are usually interactive and hence, their performance is widely based on the response of the actions that users take. The actions like mouse click, mouse movements, keyboard button press etc. when carried out, will trigger the events. Event is a piece of code that is executed when actions occur on objects like clicking on a button on the website with mouse (mouse click on specific website button) and many more similar to this. Event handling is one of the most important concepts in the .net programming which every dot net web developer should have the knowledge of. It’s not too difficult learning event handling concepts in .NET, but proper training however is mandatory to know the effective ways to handle events. ASP.NET training under the guidance of industry experts can help you learn the basics of the concept while teaching you the actual way to implement it practically. When a user performs an action, event is raised on the client side, while this is actually handled by the server. For example consider the two events in ASP.NET, the OnClick method & OnCheckChanged method. These are executed on the server, where the server calls subroutine including a set of code to be executed when a mouse button is clicked and when a radio button or a check box is checked. Following is the general syntax of an event handler method in ASP.NET. Here the first parameter represents the object that has generated the event while the second represents the event data being sent to the server. private void EventName (object sender, EventArgs e); Event Handling with Controls All the controls in ASP.NET whether a text-box, check box or drop-down list will trigger events by default when a user performs action on them. These events are generally handled by the in-built event handler methods that have a piece of code to execute when called. An event handler is coded to respond to an action and this is done in two ways generally in Visual Studio. By default, in Visual Studio an event handler including a Handles clause is created. However there could also be the one without an event handler.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.