Webapi Asp.Net C# interview Questions for freshers
Q. Expalain the List of events in asp.net page life cycle ?
A. 1) Page_PreInit 2) Page_Init 3) Page_InitComplete 4) Page_PreLoad 5) Page_Load 6) Page_LoadComplete 7) Page_PreRender 8) Render
Q. Can we have a web application running without web.Config file?
A. Yes, its possible to run a web application whereas less controll on security.
Q. What is tracing in .NET?
A. Tracing will help to see the information of issues at the runtime of the application. By default Tracing is disabled.
Tracing has the following important features:
We can see the execution path of the page and application using the debug statement.
We can access and manipulate trace messages programmatically.
We can see the most recent tracing of the data.
Tracing can be done with the following 2 types.
Page Level: When the trace output is displayed on the page and for the page-level tracing we need to set the property of tracing at the page level. <%@ Page Trace="true" Language="C#"/> Application: Level: In Application-Level tracing the information is stored for each request of the application. The default number of requests to store is 10. But if you want to increase the number of requests and discard the older request and display a recent request then you need to set the property in the web.config file.
Q. What is Databinding in asp.net application?
A. Databinding is the process of binding the data with graphical elements (controls in a window form). After binding the data in a window form, you can navigate through the records with the help of the Binding Navigator Control.
One of the advantages of data binding is, the user does not need to write the codes explicitly, for establishing the connections and creating a data set, this feature will write the necessary ADO.NET code for the user.
Q. What are the types of Databinding in asp.net?
A. This classification is based on the number of bound values that can be displayed through a control of the window form.
Two types of Databinding
Simple Data Binding
Complex Data Binding
Simple Data Binding: It is the process of binding a control to a single data element.
For Example: Binding a textbox or label with a single value.
Complex Data Binding: It is the process of binding a component to display one data element or multiple data elements.
For Example: GridView or Listbox control binding one data element or more than one records in a table.
Q. What are the major events in global.aspx in asp.net application?
A. The Global.asax file, which is derived from the HttpApplication class, maintains a pool of HttpApplication objects, and assigns them to applications as needed. The Global.asax file contains the following events:
Application_Init
Application_Disposed
Application_Error
Application_Start
Application_End
Application_BeginReques.