Updates

Asp.Net Event Handlers Question and Answers

Published On: 4/11/2023
Author: Admin
Share Now

Asp.Net Event Handler Question and Answers. These questions are based on Asp.net Event Handlers and are useful for Interview preparation

Q. 1 - What is Event Handling in ASP.Net?

An event is an action or occurrence such as a mouse click, a key press, mouse movements, or any system-generated notification. A process communicates through events.

Events in ASP.NET raised at the client machine, and handled at the server machine. For example, a user clicks a button displayed in the browser. A Click event is raised. The browser handles this client-side event by posting it to the server.

The server has a subroutine describing what to do when the event is raised; it is called the event-handler. Therefore, when the event message is transmitted to the server, it checks whether the Click event has an associated event handler. If it has, the event handler is executed.

Q. 2 - What is Event Handler?

The server has a subroutine describing what to do when the event is raised; it is called the event-handler.

Q. 3 - What happens when mouse button clicked?

When Mouse button is clicked the event message is transmitted to server. On server it checks whether the click event has an associated event handler. If event handler is associated then event handler is executed, and if no event handler is found the click event is ignored.

Q. 4 - Write Down Syntax of Event Arguments?

ASP.NET event handlers generally take two parameters and return void. The first parameter represents the object raising the event and the second parameter is event argument.

The general syntax of an event is:

private void EventName (object sender, EventArgs e);

Q. 5 - Which of the Events of Application?

The most important application events are:

  • Application_Start - It is raised when the application/website is started.
  • Application_End - It is raised when the application/website is stopped.

Q. 6 - Which of the Session Event in ASP.NET?

The most used Session events are:

  • Session_Start - It is raised when a user first requests a page from the application.
  • Session_End - It is raised when the session ends.

Q. 7 - Write Down Page and control events ?

Common page and control events are:

  • DataBinding - It is raised when a control binds to a data source.
  • Disposed - It is raised when the page or the control is released.
  • Error - It is a page event, occurs when an unhandled exception is thrown.
  • Init - It is raised when the page or the control is initialized.
  • Load - It is raised when the page or a control is loaded.
  • PreRender - It is raised when the page or the control is to be rendered.
  • Unload - It is raised when the page or control is unloaded from memory

#asp.net #programming #interview #questions #Lifecycle #EventHandlers , asp net questions, asp dot net interview questions, asp net interview questions and answers, asp net basic interview questions, asp net c# interview questions

Practice Tests Available

Currently no practice papers available for above exam. We are working on it and tests will be available soon.

Advertisement

Subjects (Free Online Tests)

Your Comment:
Name :
Comment :
(0) Comments:

 Full Length Mock Tests
 Answers with Explanation**
 Timer Based Exams
 Instant Result and assesment
 Detailed analasys of Result