SOOPRO Pathshala provides ASP.NET Interview Questions and Answers
ASP.NET is a server-side technology used for developing dynamic websites and web applications on the internet. It also produces data-driven web applications.
ASP.NET is a cross-platform which works on the .NET framework and runs on Linux, Windows, macOS, and Docker.
When ASP.NET pages run, it goes through several steps of the life cycle, which performs a series of actions like initialization, running, restoring, and rendering
Life Cycle is classified into two categories.
1. Application Life Cycle: The user requests for accessing the application.
2. Page Life Cycle: Page Life Cycle has phases like initialization, restoring, execution, and page rendering.
MVC is a software architectural pattern that divides an application into three main parts Model, View, and Controller.
Model:- Model helps to create the data domain of the application and represents the public properties and business logic of the application.
View:- View represents the data tables, charts, and diagrams by collecting the data from the model.
Controller:- The controller helps in handling the user interactions and controls the flow of the application.
ASP.NET uses Object-Oriented programming languages that provide a framework and patterns, which are easy to use. Languages used by ASP.NET Framework are :
C# C-Sharp is a programming language developed by Microsoft that runs on the .NET framework. It is used for developing web applications on the .NET framework.
VB.NET VB.NET is a modern object-oriented programming language developed by Microsoft to combine the features of CLR and .NET.
A library is a pre-coded Object-Oriented Programming template collection used to develop web-based and desktop applications in ASP.NET.
ASP.NET uses a Web Library to develop web applications.
Internet Information Server (IIS) is the most popular web server used to host and provide internet-based services to ASP.NET and ASP Web applications.
IIS has its own process engine to handle the requests. Using an IIS computer can work as a web server, and provides functionality to deploy ASP.NET Web applications. It is also responsible for providing responses to the requests made by the users.
Application Life Cycle is of five types:
Application Start: Application Start is a method that you execute when a user makes a request.
Object Creation: Object Creation contains all the information about current requests and browsing information.
HTTP Application: HTTP Application processes all subsequent requests sent to the application.
Dispose: Dispose is responsible for releasing manually unwanted resources.
Application End: Application End helps to unload the memory of an application.
Active Server Page is an HTML page used to develop dynamic web pages. It includes one or more scripts on the Microsoft web server before sending the request to the user.
Web forms are web pages that a user requests using a browser. It is built using ASP.NET technology.
Solution Explorer displays the folder and files of a project that appears on a physical hard drive.
ASP.NET provides data-driven web applications on the internet using various components.
ASP is the first server-side scripting language developed by Microsoft to design dynamic web forms
ASP.NET is a server-side technology used for developing dynamic websites and web applications on the internet
ASP is written in VBScript.
ASP.NET is written in C#.
Web service is a web-based functionality accessed by using protocols. It uses XML to exchange the software using common internet protocols.
The HTTP protocol is used in ASP.NET to call a Web Service.
Global.asax is used to handle high-level applications like Application_Start, Session_End, Session_Start
Global file is also used to execute the application-level events and set application-level variables.
View State is a Page-Level State Management technique that is used to preserve the values of the page and controls.
Multi-View is a parent control for the View. It is used to control all types of views.
Early Binding is used to check the methods and properties during compilation. It is fast and easy to code and also reduces the compilation time. It also reduces the time by identifying the errors.
Late Binding takes more time to compile. It is hard to find out the object through Late Binding. Late Binding has dynamic objects and is achieved by virtual machines.
ASP.NET is used to build applications for windows
ASP.NET Core is used for windows, mac OS and Linux
Caching is a technique of storing frequently used data/information in memory, so that, when the same data/information is needed next time, it could be directly retrieved from the memory instead of being generated by the application.
Tracing enables view diagnostic information about a single request at runtime and debug the application. The trace contains features, background, code examples, and class references.
Page layout provides an overall container for the pages on the website. For example, Navigation Area and Footer. Page layout also includes the main content.
Event bubbling is used by data-bound controls. When a parent control contains child controls, and when an event occurs in child controls, it bubbles the event to the parent; this is called Event bubbling.
Some common built-in objects of ASP.NET are:
Session: Describes the methods and properties of the objects and stores the information related to the user.
Context: Describes wrapper for the object.
Application: Describes the methods and properties of the objects and stores the information related to the web application.
Request: Describes the methods and properties of the objects and stores the information related to the HTTP requests.
Server: Describes the methods and properties of the objects from various servers.
Response: Describes the methods and properties of the objects and stores the information related to the server response.
A breakpoint helps to specify the runtime to run a line of a line and stop the execution. It is used to examine and perform various debugging functions and methods.
In multithreading, each thread has its own priority that gains access to CPU resources; whenever a thread is created in C#, it always possesses some priority.
Postback is a request sent from a client to the server from the page on which the user is working. It posts the complete page back to the server for a new page.
Postback is submitted to a server before processing the page and holds credentials such as verification like username and passwords using a database.
Web Configuration is used to describe the property and behaviour of web applications. It also helps to manage settings. Each file of a web configuration is an XML file that contains a set of configuration elements.
Anonymous Personalization helps and allows the user to personalize the site before identifying themselves.
Form-Based authentication is used to edit the web configuration files and add a login page to authenticate. It is used for web applications. Form-based authentication also provides a way to handle authentication using custom logics in ASP.NET applications.
Configuration files help to manage the settings of a website. Settings of configuration files are stored as XML files which are separate from the application.
Configuration files are two types:
Web Configuration: It contains the machine-specific value for all settings of the application.
Machine Configuration: It helps to extend, restrict and override the settings
custom control is designed for a single application
user controlUser control is designed for multiple applications.
Custom control is loosely coupled.
User control is tightly coupled.
ASP.Net is the next generation of ASP technology platform. It is superior to ASP in the following ways:
Highly Scalable
Compiled Code
User Authentication
Language Support
Third party control
Configuration and Deployment are easy
Object and Page caching
Strict coding requirements
The "IsPostBack" property of page object is used to check that the page is posted back or not.
System.Web.UI.Control class
Debug class is used to debug builds. Trace class is used for both debug and release builds.
Globalization: Globalization is a technique to identify the part of a Web application that is different for different languages and separate it out from the web application.
Localization: In localization, you try to configure a Web application so that it can be supported for a specific language or locale.
Authentication is a process of identifying user whereas authorization is used to check the access rights of an identified user.
Response.Write() is used for normal output whereas Response.Output.Write() is used for formatted output.
Role-based security is used in almost all organization, and the Role-based security assigns certain privileges to each role.
Each user is assigned a particular role from the list.
Privileges as per role restrict the user's actions on the system and ensure that a user can do only what he is permitted to do on the system.
30 minutes.
HTTP protocol
The File extension of web service is .asmx.
The Global.asax file is used to execute the application-level events and sets application-level variables.
If a website provides content in many languages, it is known as a multilingual website. It contains multiple copies of its content and other resources, such as date and time, in different languages.
IIS stands for Internet Information Services. It is created by Microsoft to provide Internet-based services to ASP.NET Web applications.