SlideShare uma empresa Scribd logo
1 de 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., 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.
For example, let us consider that there is an event for mouse button click and the event Click() is
generated. Then following are the codes written with and without Handles clause for the event.
ASP tag for Button Control
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
Event Code for Click Event
Protected Sub btnCancel_Click(ByVal sender As Object,
ByVal e As System.EventArgs)
Handles btnCancel.Click //with handles clause
End Sub
ASP tag for Button Control
<asp:Button ID="btnCancel" runat="server" Text="Cancel"
Onclick="btnCancel_Click" />
Event Code for Click Event
Protected Sub btnCancel_Click(ByVal sender As Object,
ByVal e As System.EventArgs) //without handles clause
End Sub
Hence, most often for the buttons like image button, link button and image map controls, events called
Click or Command will be generated that take OnClick or OnCommand attributes respectively. Apart
from this there are various other controls used in ASP.NET like text box, drop-down 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 which they are generated are shown in the below
table.
Control
BulletedList
Button
DataGrid
DropDownList
HyperLink
ImageButton
ListBox
Menu
RadioButton
RadioButtonList
CheckBox
CheckBoxList

Event generated by Default
Click
Click
SelectedIndexChanged
SelectedIndexChanged
Click
Click
SelectedIndexChanged
MenuItemClick
CheckedChanged
SelectedIndexChanged
CheckedChanged
SelectedIndexChanged

So, in order to more about the controls and the respective events required to handle the actions
performed on these controls for effective .NET development, one should join ASP.NET training.
Through .NET training one can learn this concept of event handling through practical methods and will
also get the support of teaching experts who can clarify the doubts that may arise in the minds of the
learners while practice. This is the major benefit a learner can get by joining .NET training rather than
opting for other options like online learning or self learning through books.
**************************************************************************
Author Box:
TOPS Technologies is one of the top IT training institutes offering the best ASP.NET training courses in
Ahmedabad for freshers and students. The institute provides industry-oriented C# and ASP.Net training
course and Microsoft certification .NET training for that looking build career in .NET development.

Mais conteúdo relacionado

Mais de TOPS Technologies

Software testing and quality assurance
Software testing and quality assuranceSoftware testing and quality assurance
Software testing and quality assuranceTOPS Technologies
 
Learn advanced java programming
Learn advanced java programmingLearn advanced java programming
Learn advanced java programmingTOPS Technologies
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applicationsTOPS Technologies
 
What is ui element in i phone developmetn
What is ui element in i phone developmetnWhat is ui element in i phone developmetn
What is ui element in i phone developmetnTOPS Technologies
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applicationsTOPS Technologies
 
Software testing live project training
Software testing live project trainingSoftware testing live project training
Software testing live project trainingTOPS Technologies
 
Web designing live project training
Web designing live project trainingWeb designing live project training
Web designing live project trainingTOPS Technologies
 
iPhone training in ahmedabad by tops technologies
iPhone training in ahmedabad by tops technologiesiPhone training in ahmedabad by tops technologies
iPhone training in ahmedabad by tops technologiesTOPS Technologies
 
08 10-2013 gtu projects - develop final sem gtu project in i phone
08 10-2013 gtu projects - develop final sem gtu project in i phone08 10-2013 gtu projects - develop final sem gtu project in i phone
08 10-2013 gtu projects - develop final sem gtu project in i phoneTOPS Technologies
 
GTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesGTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesTOPS Technologies
 
GTU Asp.net Project Training Guidelines
GTU Asp.net Project Training GuidelinesGTU Asp.net Project Training Guidelines
GTU Asp.net Project Training GuidelinesTOPS Technologies
 
GTU Guidelines for Project on JAVA
GTU Guidelines for Project on JAVAGTU Guidelines for Project on JAVA
GTU Guidelines for Project on JAVATOPS Technologies
 
GTU Guidelines for Project on Android
GTU Guidelines for Project on AndroidGTU Guidelines for Project on Android
GTU Guidelines for Project on AndroidTOPS Technologies
 
GTU MCA PHP Interview Questions And Answers for freshers
GTU MCA PHP  Interview Questions And Answers for freshersGTU MCA PHP  Interview Questions And Answers for freshers
GTU MCA PHP Interview Questions And Answers for freshersTOPS Technologies
 

Mais de TOPS Technologies (20)

How to install android sdk
How to install android sdkHow to install android sdk
How to install android sdk
 
Software testing and quality assurance
Software testing and quality assuranceSoftware testing and quality assurance
Software testing and quality assurance
 
Basics in software testing
Basics in software testingBasics in software testing
Basics in software testing
 
Learn advanced java programming
Learn advanced java programmingLearn advanced java programming
Learn advanced java programming
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
What is ui element in i phone developmetn
What is ui element in i phone developmetnWhat is ui element in i phone developmetn
What is ui element in i phone developmetn
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Java live project training
Java live project trainingJava live project training
Java live project training
 
Software testing live project training
Software testing live project trainingSoftware testing live project training
Software testing live project training
 
Web designing live project training
Web designing live project trainingWeb designing live project training
Web designing live project training
 
Php live project training
Php live project trainingPhp live project training
Php live project training
 
iPhone training in ahmedabad by tops technologies
iPhone training in ahmedabad by tops technologiesiPhone training in ahmedabad by tops technologies
iPhone training in ahmedabad by tops technologies
 
Php training in ahmedabad
Php training in ahmedabadPhp training in ahmedabad
Php training in ahmedabad
 
Java training in ahmedabad
Java training in ahmedabadJava training in ahmedabad
Java training in ahmedabad
 
08 10-2013 gtu projects - develop final sem gtu project in i phone
08 10-2013 gtu projects - develop final sem gtu project in i phone08 10-2013 gtu projects - develop final sem gtu project in i phone
08 10-2013 gtu projects - develop final sem gtu project in i phone
 
GTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesGTU PHP Project Training Guidelines
GTU PHP Project Training Guidelines
 
GTU Asp.net Project Training Guidelines
GTU Asp.net Project Training GuidelinesGTU Asp.net Project Training Guidelines
GTU Asp.net Project Training Guidelines
 
GTU Guidelines for Project on JAVA
GTU Guidelines for Project on JAVAGTU Guidelines for Project on JAVA
GTU Guidelines for Project on JAVA
 
GTU Guidelines for Project on Android
GTU Guidelines for Project on AndroidGTU Guidelines for Project on Android
GTU Guidelines for Project on Android
 
GTU MCA PHP Interview Questions And Answers for freshers
GTU MCA PHP  Interview Questions And Answers for freshersGTU MCA PHP  Interview Questions And Answers for freshers
GTU MCA PHP Interview Questions And Answers for freshers
 

Último

THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECTTHE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT17mos052
 
Amplify Your Brand with Our Tailored Social Media Marketing Services
Amplify Your Brand with Our Tailored Social Media Marketing ServicesAmplify Your Brand with Our Tailored Social Media Marketing Services
Amplify Your Brand with Our Tailored Social Media Marketing ServicesNetqom Solutions
 
Unveiling SOCIO COSMOS: Where Socializing Meets the Stars
Unveiling SOCIO COSMOS: Where Socializing Meets the StarsUnveiling SOCIO COSMOS: Where Socializing Meets the Stars
Unveiling SOCIO COSMOS: Where Socializing Meets the StarsSocioCosmos
 
Top 5 Ways To Use Reddit for SEO SEO Expert in USA - Macaw Digital
Top 5 Ways To Use Reddit for SEO  SEO Expert in USA - Macaw DigitalTop 5 Ways To Use Reddit for SEO  SEO Expert in USA - Macaw Digital
Top 5 Ways To Use Reddit for SEO SEO Expert in USA - Macaw Digitalmacawdigitalseo2023
 
Values Newsletter teamwork section 2023.pdf
Values Newsletter teamwork section 2023.pdfValues Newsletter teamwork section 2023.pdf
Values Newsletter teamwork section 2023.pdfSoftServe HRM
 
Dubai Calls Girls Busty Babes O525547819 Call Girls In Dubai
Dubai Calls Girls Busty Babes O525547819 Call Girls In DubaiDubai Calls Girls Busty Babes O525547819 Call Girls In Dubai
Dubai Calls Girls Busty Babes O525547819 Call Girls In Dubaikojalkojal131
 
The--Fraud: Netflix Original Media Pitch
The--Fraud: Netflix Original Media PitchThe--Fraud: Netflix Original Media Pitch
The--Fraud: Netflix Original Media Pitch17mos052
 

Último (7)

THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECTTHE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
 
Amplify Your Brand with Our Tailored Social Media Marketing Services
Amplify Your Brand with Our Tailored Social Media Marketing ServicesAmplify Your Brand with Our Tailored Social Media Marketing Services
Amplify Your Brand with Our Tailored Social Media Marketing Services
 
Unveiling SOCIO COSMOS: Where Socializing Meets the Stars
Unveiling SOCIO COSMOS: Where Socializing Meets the StarsUnveiling SOCIO COSMOS: Where Socializing Meets the Stars
Unveiling SOCIO COSMOS: Where Socializing Meets the Stars
 
Top 5 Ways To Use Reddit for SEO SEO Expert in USA - Macaw Digital
Top 5 Ways To Use Reddit for SEO  SEO Expert in USA - Macaw DigitalTop 5 Ways To Use Reddit for SEO  SEO Expert in USA - Macaw Digital
Top 5 Ways To Use Reddit for SEO SEO Expert in USA - Macaw Digital
 
Values Newsletter teamwork section 2023.pdf
Values Newsletter teamwork section 2023.pdfValues Newsletter teamwork section 2023.pdf
Values Newsletter teamwork section 2023.pdf
 
Dubai Calls Girls Busty Babes O525547819 Call Girls In Dubai
Dubai Calls Girls Busty Babes O525547819 Call Girls In DubaiDubai Calls Girls Busty Babes O525547819 Call Girls In Dubai
Dubai Calls Girls Busty Babes O525547819 Call Girls In Dubai
 
The--Fraud: Netflix Original Media Pitch
The--Fraud: Netflix Original Media PitchThe--Fraud: Netflix Original Media Pitch
The--Fraud: Netflix Original Media Pitch
 

Learn Event Handling in ASP.NET through .NET Training

  • 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.
  • 2. For example, let us consider that there is an event for mouse button click and the event Click() is generated. Then following are the codes written with and without Handles clause for the event. ASP tag for Button Control <asp:Button ID="btnCancel" runat="server" Text="Cancel" /> Event Code for Click Event Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click //with handles clause End Sub ASP tag for Button Control <asp:Button ID="btnCancel" runat="server" Text="Cancel" Onclick="btnCancel_Click" /> Event Code for Click Event Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) //without handles clause End Sub Hence, most often for the buttons like image button, link button and image map controls, events called Click or Command will be generated that take OnClick or OnCommand attributes respectively. Apart from this there are various other controls used in ASP.NET like text box, drop-down 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 which they are generated are shown in the below table. Control BulletedList Button DataGrid DropDownList HyperLink ImageButton ListBox Menu RadioButton RadioButtonList CheckBox CheckBoxList Event generated by Default Click Click SelectedIndexChanged SelectedIndexChanged Click Click SelectedIndexChanged MenuItemClick CheckedChanged SelectedIndexChanged CheckedChanged SelectedIndexChanged So, in order to more about the controls and the respective events required to handle the actions performed on these controls for effective .NET development, one should join ASP.NET training. Through .NET training one can learn this concept of event handling through practical methods and will
  • 3. also get the support of teaching experts who can clarify the doubts that may arise in the minds of the learners while practice. This is the major benefit a learner can get by joining .NET training rather than opting for other options like online learning or self learning through books. ************************************************************************** Author Box: TOPS Technologies is one of the top IT training institutes offering the best ASP.NET training courses in Ahmedabad for freshers and students. The institute provides industry-oriented C# and ASP.Net training course and Microsoft certification .NET training for that looking build career in .NET development.