ASP.NET Web Applications Flashcards
7 cards from real MCTS practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 ASP.NET Web Applications flashcards as text
Which ASP.NET caching mechanism stores data in memory on the web server and supports dependencies on files, keys, or SQL tables?
Answer: Application cache (HttpRuntime.Cache)
HttpRuntime.Cache (also accessible as HttpContext.Cache) is the ASP.NET application cache that supports expiration policies and dependencies on external resources like files or database tables.
In ASP.NET MVC Razor views, what does the @model directive declare?
Answer: The strongly-typed data model the view expects to receive from the controller
The @model directive specifies the type of the Model property in the Razor view, enabling IntelliSense and compile-time checking for the data passed from the controller.
Which ASP.NET feature allows you to run code before and after the application starts and stops by implementing methods in Global.asax?
Answer: Application lifecycle events (Application_Start, Application_End)
Global.asax exposes application lifecycle event handlers like Application_Start and Application_End that run when the web application initializes or shuts down.
What is the correct way to enable SSL/HTTPS requirement for an entire ASP.NET MVC controller?
Answer: Apply [RequireHttps] to the controller class
[RequireHttps] is a built-in MVC filter attribute that redirects HTTP requests to HTTPS when applied to a controller or action method.
In ASP.NET, what is the difference between authentication and authorization?
Answer: Authentication verifies who the user is; authorization determines what they are allowed to do
Authentication is the process of verifying a user's identity (who they are), while authorization is the process of determining what resources or actions that verified identity is permitted to access.
Which ASP.NET Web API class should you inherit from when creating a RESTful API controller?
Answer: ApiController
ApiController is the base class for ASP.NET Web API controllers, providing HTTP-specific behavior like content negotiation and model binding optimized for RESTful services.
What is the function of the bundling and minification feature introduced in ASP.NET 4.5?
Answer: It combines multiple CSS or JavaScript files into single files and removes whitespace to reduce page load time
Bundling combines multiple script or style files into a single HTTP request, and minification removes unnecessary whitespace and shortens variable names, both reducing page load time.