What is the primary purpose of ASP.NET in web development?
Answer: A
ASP.NET is a server-side web application framework developed by Microsoft for building dynamic, interactive web applications.
Q.2Easy
Which of the following is the latest version of ASP.NET as per 2024-2025?
Answer: B
ASP.NET Core 8.0 is the latest unified platform as of 2024-2025, replacing the older ASP.NET Framework.
Q.3Easy
What does CLR stand for in the context of .NET?
Answer: A
CLR (Common Language Runtime) is the virtual machine that executes .NET code, managing memory, security, and type safety.
Q.4Medium
In ASP.NET, what is the purpose of the Global.asax file?
Answer: A
Global.asax handles application-level events like Application_Start, Application_End, and Session_Start.
Q.5Medium
Which attribute is used to mark a method as an HTTP endpoint in ASP.NET Core?
Answer: B
[HttpGet], [HttpPost], [HttpPut], [HttpDelete] attributes define HTTP methods for controller actions in ASP.NET Core.
Advertisement
Q.6Medium
What is the difference between ASP.NET Framework and ASP.NET Core?
Answer: A
ASP.NET Core is cross-platform (Windows, Linux, macOS) and open-source, while ASP.NET Framework is Windows-only.
Q.7Medium
Which of the following is NOT a built-in state management technique in ASP.NET?
Answer: D
ViewState, Session State, Application State, and Cookies are valid state management techniques. Block State is not a standard ASP.NET technique.
Q.8Medium
What is the role of Middleware in ASP.NET Core?
Answer: A
Middleware components handle cross-cutting concerns like authentication, logging, and exception handling in the request pipeline.
Q.9Medium
In an ASP.NET Core application, where is Dependency Injection configured?
Answer: A
Dependency Injection is configured in the ConfigureServices method of Startup.cs (or Program.cs in newer versions).
Q.10Medium
What is the purpose of the [ValidateAntiForgeryToken] attribute in ASP.NET MVC?
Answer: A
[ValidateAntiForgeryToken] verifies that form submissions come from your application, preventing CSRF attacks.
Q.11Medium
Which of the following methods is used to pass data from Controller to View in ASP.NET MVC?
Answer: A
ViewBag (dynamic) and ViewData (dictionary) are common ways to pass data from Controller to View in ASP.NET MVC.
Q.12Hard
A web application needs to store a user preference that persists across multiple browser sessions. Which state management technique is most appropriate?
Answer: A
For persistent data across multiple sessions, database storage is the best approach. Session State is temporary and Application State is server-wide.
Q.13Hard
What is the correct order of Page Lifecycle events in ASP.NET Web Forms?
Answer: A
ASP.NET Web Forms lifecycle: Init → Load → Event Handling (ViewState restored) → Render → Unload.
Q.14Easy
In ASP.NET Core, what is the purpose of the appsettings.json file?
Answer: A
appsettings.json stores application configuration like connection strings, logging levels, and custom settings.
Q.15Hard
An e-commerce application needs to handle concurrent user requests efficiently. Which ASP.NET Core feature is most suitable?
Answer: A
Async/Await enables non-blocking I/O operations, allowing ASP.NET Core to handle more concurrent requests efficiently.
Q.16Medium
What is Entity Framework in ASP.NET context?
Answer: A
Entity Framework is Microsoft's ORM that allows developers to work with databases using .NET objects instead of raw SQL.
Q.17Hard
In ASP.NET Core, which method is used to register services in the dependency injection container?
Answer: A
AddScoped, AddSingleton, and AddTransient are methods to register services with different lifetimes in ASP.NET Core DI.
Q.18Easy
What does MVC stand for in ASP.NET MVC?
Answer: A
MVC (Model-View-Controller) is an architectural pattern separating data (Model), presentation (View), and business logic (Controller).
Q.19Hard
A developer needs to create a RESTful API that returns JSON data. Which ASP.NET approach is most suitable?
Answer: A
ASP.NET Core Web API with [ApiController] attribute is the modern approach for building RESTful APIs that return JSON.