MVC 5 important ques

Date - 19/03/2016 !! For new ques, scroll down...
-----------------------------------------------------------------------------
What are the new features in Asp.Net MVC5 ?
  • Introducing One ASP.NET
  • Introducing Asp.Net One Identity
  • Introducing Bootstrap in the MVC template
  • Introducing Filter overrides (Overriding filters)
  • Introducing Authentication Filters
  • Introducing Web API 2
  • Introducing OAuth 2.0 Authorization in MVC 5
  • OData Improvements in MVC 5(Full support for $select, $expand, $batch, and $value)
  • Introducing ASP.NET SignalR 2.0

ASP.NET WEB API 2

  • Attribute routing

What is One ASP.NET ?

Web MVC project templates integrated with the new One ASP.NET experience. we can customize our MVC project and configure authentication by using One ASP.NET project creation wizard.

One ASP.NET

=> Asp.Net + Site + Services + Web Forms + Web Pages + Single Page + MVC + Web API + Single R

What is the structure of ASP.NET MVC 5 and release’s ?

One ASP.NET release Summary

What’s Bootstrap is new MVC 5 ?
MVC project template is updated in MVC 5 to use Bootstrap for better look and feel. Now you can easily customize. For more information

Bootstrap In Short:

  • With the updated MVC template, You can do Customization very easily
  • Better look and feel.

What is ASP.NET Web API 2 ?

Self-Hosted Web API
  • Multiple Routes (Get Routes) on an Action
  • Route Defaults (With Default Parameters)
  • Route Parameters as optional
  • Route Constraints
  • Chaining and Combining with Defaults and Optionals
  • Named Routes
  • Route Prefixe (New Attribute)
[RoutePrefix(“Blog/{BlogId}”)]
public class BlogController : ControllerBase
{
GET(“Blogs”)]
public ActionResult Index(int BlogId) { /* … */ }
}

What are new updates in ASP.NET MVC 5 Areas ?

  • Overriding the Area URL Prefix
  • Ignoring Area URLs for Certain Routes

What are advanced features of ASP.NET MVC 5 ?

  • Localizing URL’s
  • Newly Added provider FluentTranslationProvider
  • Newly Route Convention Attribute
  • Subdomain Routing

LOCALIZING URL’S

We can localize our URL’s using an AttribtueRouting translation provider. A translation provider is useful to work against resx files, databases, etc. To create our own, simply extend
routes.MapAttributeRoutes(myConfig =>
{
myConfig.AddTranslationProvider(new MyCustomTranslationProvider());
});

ROUTE CONVENTION ATTRIBUTE ATTRIBUTE

public class MyRouteConventionAttribute : RouteConventionAttributeBase
{
public override IEnumerable
GetRouteAttributes(MethodInfo actionMethod)
{
// TODO: Yield IRouteAttributes (GET/POST/PUT/DELETE/Route).
}
}

SUBDOMAIN ROUTING

Wc can map our ASP.NET MVC areas to subdomains by using the Subdomain property of the RouteAreaAttribute. Doing so ensures that the routes for the area are matched only when requests are made to the specified subdomain. Here’s how:
[RouteArea(“Users”, Subdomain = “users”)]
public class SubdomainController : Controller
{
[GET(“”)]
public ActionResult Index() { /* … */ }
}
Is OAuth 2.0 support’s for Web API and Single Page Application ?
The MVC Web API and Single Page Application project templates now support authorization using OAuth 2.0. OAuth 2.0 is a authorization framework for authorizing client access to protected resources. It works for a variety of clients like for different browsers & mobile devices.
What are the OData Improvements ?
Full Support for $select, $expand, $batch & $value
Much improved extensibility
Type less support (No need to define CLR types)


DATE : 2025 !! 


Top 100+ .NET MVC Interview Questions for Developers

This document provides a comprehensive list of interview questions for .NET MVC developers, ranging from fundamental concepts to advanced topics. These questions are designed to test a candidate's understanding of the MVC pattern, its implementation in .NET, and best practices.

I. Core MVC Fundamentals

  1. What is the MVC (Model-View-Controller) design pattern?

  2. Explain the role of each component in MVC (Model, View, Controller).

  3. What are the advantages of using MVC?

  4. What are the disadvantages or challenges of using MVC?

  5. How is ASP.NET MVC different from ASP.NET Web Forms?

  6. Explain the lifecycle of an ASP.NET MVC request.

  7. What is a Controller in ASP.NET MVC? How do you define one?

  8. What is an Action Method?

  9. What are Action Filters? Give some examples.

  10. What is a View in ASP.NET MVC? What is its purpose?

  11. What is a Model in ASP.NET MVC?

  12. What is Razor View Engine? What are its benefits?

  13. Explain the difference between ViewBag, ViewData, and TempData. When would you use each?

  14. What is Partial View? When should you use it?

  15. What is Layout Page? How is it similar to Master Pages in Web Forms?

  16. What is Strongly-Typed View? What are its benefits?

  17. What is Routing in ASP.NET MVC?

  18. Explain the concept of Route Table and Route Handlers.

  19. How do you define a custom route?

  20. What is Attribute Routing? How is it configured?

II. Controllers and Action Methods

  1. What is ActionLink and how does it work?

  2. How do you pass data from a Controller to a View?

  3. What are Action Results? List different types of Action Results.

  4. Explain ViewResult, PartialViewResult, JsonResult, ContentResult, RedirectResult, RedirectToRouteResult.

  5. How do you handle exceptions in ASP.NET MVC?

  6. What are Child Actions? When would you use them?

  7. Explain ActionName attribute and NonAction attribute.

  8. How do you restrict an Action Method to specific HTTP verbs (GET, POST)?

  9. What is Model Binding? How does it work?

  10. Explain how Custom Model Binders can be created.

  11. What is RouteData?

  12. What is Url.Action and Html.ActionLink? Explain their differences.

  13. How can you inject dependencies into Controllers?

  14. Explain the purpose of OutputCache attribute.

  15. What is the difference between [HttpPost] and [ValidateAntiForgeryToken]?

III. Views and Data Presentation

  1. How do you render a Partial View within a View?

  2. What is Html.RenderPartial() vs Html.Partial()?

  3. How do you render a Child Action within a View?

  4. What is Html.RenderAction() vs Html.Action()?

  5. Explain the role of @model directive in Razor Views.

  6. How do you use Html Helpers? Give examples.

  7. What are Custom Html Helpers? How do you create one?

  8. What is Unobtrusive JavaScript? How does it relate to MVC?

  9. How do you include JavaScript and CSS files in MVC?

  10. What is Bundling and Minification? Why is it used?

  11. Explain the concept of ViewStart.cshtml.

  12. What is ViewModel? Why is it useful?

  13. How do you use EditorFor and DisplayFor templates?

  14. What is Scaffolding in MVC?

  15. How can you pass data from a Partial View back to its parent Controller?

IV. Routing

  1. What is the default routing convention in ASP.NET MVC?

  2. Explain the order of routing registration.

  3. How do you create a catch-all route?

  4. What is the purpose of RouteConfig.cs?

  5. How do you define optional URL parameters in routes?

  6. What are Route Constraints? Give an example.

  7. How does ASP.NET MVC determine which controller and action to execute based on a URL?

  8. Explain Url Generation in MVC.

  9. What is the difference between Url.RouteUrl and Url.Action?

  10. How do you handle routing for static files?

V. Data Access and Validation

  1. How do you integrate Entity Framework with ASP.NET MVC?

  2. What is Code-First, Model-First, and Database-First approach in Entity Framework?

  3. Explain Data Annotations for validation in MVC.

  4. How do you implement Custom Validation Attributes?

  5. What is Client-side Validation vs Server-side Validation? How does MVC support both?

  6. How does MVC handle ModelState?

  7. What is CRUD operation in the context of MVC?

  8. How do you handle Concurrency issues in a web application using MVC and Entity Framework?

  9. What is Repository Pattern? Why use it with MVC?

  10. Explain the Unit of Work pattern.

  11. How do you perform asynchronous data retrieval in MVC?

VI. Security

  1. What is Cross-Site Scripting (XSS)? How can MVC help prevent it?

  2. What is Cross-Site Request Forgery (CSRF)? How can MVC help prevent it?

  3. Explain the purpose of [ValidateAntiForgeryToken] attribute.

  4. How do you implement Authentication and Authorization in ASP.NET MVC?

  5. What are Authorization Filters?

  6. How does Forms Authentication work in MVC?

  7. What is Role-Based Authorization? How is it implemented?

  8. How do you secure AJAX calls in MVC?

  9. What are OWIN and Katana? How do they relate to MVC security?

VII. Performance and Scalability

  1. How can you improve the performance of an ASP.NET MVC application?

  2. Explain Caching in MVC.

  3. What is Output Caching? Where can it be applied?

  4. How does Donut Caching work?

  5. What is Asynchronous Controllers and Action Methods? When should you use them?

  6. Explain Lazy Loading in Entity Framework.

  7. What is the impact of N+1 Query problem? How to avoid it?

  8. How do you profile an ASP.NET MVC application for performance bottlenecks?

  9. What is Minification and Bundling for scripts and styles?

  10. How do you scale an ASP.NET MVC application?

VIII. Deployment and Best Practices

  1. How do you deploy an ASP.NET MVC application?

  2. What are IIS (Internet Information Services) configurations relevant to MVC?

  3. Explain Web.config transformations for different environments.

  4. What is Dependency Injection (DI)? Why is it important in MVC applications?

  5. Name some popular DI containers used with .NET MVC.

  6. What is Test Driven Development (TDD)? How do you apply it to MVC?

  7. How do you unit test Controllers and Action Methods?

  8. What is Mocking? Why is it used in unit testing?

  9. What are Areas in ASP.NET MVC? When would you use them?

  10. What is Attribute-based Authorization vs Policy-based Authorization?

  11. Explain Cross-Origin Resource Sharing (CORS) in MVC and how to handle it.

  12. What is the role of Global.asax in an MVC application?

  13. What is ViewModel vs Domain Model?

  14. What is MVC Core and how does it differ from traditional ASP.NET MVC?

    For answers go to latest blog!!