Вы находитесь на странице: 1из 3

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., ill trigger events in ASP that are handled by event handler methods that have a piece of code to execute hen called. ************************************************** Article! ASP.NET is one of the most popular programming languages used for the development of ebsites and applications. These ebsites or applications are usually interactive and hence, their performance is idely based on the response of the actions that users take. The actions like mouse click, mouse movements, keyboard button press etc. hen carried out, ill trigger the events. Event is a piece of code that is executed hen actions occur on ob"ects like clicking on a button on the ebsite ith mouse #mouse click on specific ebsite button$ and many more similar to this. Event handling is one of the most important concepts in the .net programming hich every dot net eb developer should have the kno ledge of. %t&s not too difficult learning event handling concepts in .NET, but proper training ho ever is mandatory to kno the effective ays to handle events. ASP.NET training under the guidance of industry experts can help you learn the basics of the concept hile teaching you the actual ay to implement it practically. 'hen a user performs an action, event is raised on the client side, actually handled by the server. hile this is

(or example consider the t o events in ASP.NET, the )n*lick method + )n*heck*hanged method. These are executed on the server, here the server calls subroutine including a set of code to be executed hen a mouse button is clicked and hen a radio button or a check box is checked. (ollo ing is the general syntax of an event handler method in ASP.NET. ,ere the first parameter represents the ob"ect that has generated the event hile 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 hether a text-box, check box or drop-do n list ill trigger events by default hen 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 hen called. An event handler is coded to respond to an action and this is done in t o ays generally in .isual Studio. /y default, in .isual Studio an event

handler including a ,andles clause is created. ,o ever there could also be the one ithout an event handler. (or example, let us consider that there is an event for mouse button click and the event *lick#$ is generated. Then follo ing are the codes ritten ith and ithout ,andles clause for the event. ASP tag for utton Control 0asp!/utton %123btn*ancel3 runat23server3 Text23*ancel3 45 Event Code for Cli!" Event Protected Sub btn*ancel6*lick#/y.al sender As )b"ect, /y.al e As System.EventArgs$ ,andles btn*ancel.*lick 44 ith handles clause End Sub ASP tag for utton Control 0asp!/utton %123btn*ancel3 runat23server3 Text23*ancel3 )nclick23btn*ancel6*lick3 45 Event Code for Cli!" Event Protected Sub btn*ancel6*lick#/y.al sender As )b"ect, /y.al e As System.EventArgs$ 44 ithout handles clause End Sub ,ence, most often for the buttons like image button, link button and image map controls, events called *lick or *ommand ill be generated that take )n*lick or )n*ommand attributes respectively. Apart from this there are various other controls used in ASP.NET like text box, drop-do n list, check box list etc. that have different in-built events generated every time they are used. Some of the commonly generated events and their respective controls from hich they are generated are sho n in the belo table. Control /ulleted7ist /utton 1ata8rid 1rop1o n7ist ,yper7ink %mage/utton 7ist/ox 9enu :adio/utton :adio/utton7ist *heck/ox *heck/ox7ist Event generated #y $efault *lick *lick Selected%ndex*hanged Selected%ndex*hanged *lick *lick Selected%ndex*hanged 9enu%tem*lick *hecked*hanged Selected%ndex*hanged *hecked*hanged Selected%ndex*hanged

So, in order to more about the controls and the respective events re;uired to handle the actions performed on these controls for effective .NET development, one should "oin ASP.NET training. Through .NET training one can learn this concept of event handling through practical methods and ill also get the support of teaching experts ho can clarify the doubts that may arise in the minds of the learners hile practice. This is the ma"or benefit a learner can get by "oining .NET training rather than opting for other options like online learning or self learning through books. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Author /ox! T)PS Technologies is one of the top %T training institutes offering the best ASP.NET training courses in Ahmedabad for freshers and students. The institute provides industry-oriented *= and ASP.Net training course and 9icrosoft certification .NET training for that looking build career in .NET development.

Вам также может понравиться