Home » » MVC Interview Questions and Module -3

MVC Interview Questions and Module -3

What are the various types of Application Templates used to create an MVC application?
The various templates are as follows,

1. The Internet Application template: This contains the beginnings of an MVC web
application — enough so that you can run the application immediately after creating it
and see a few pages. This template also includes some basic account management functions which run against the ASP.NET Membership .

2. The Intranet Application template: The Intranet Application template was added as part of
the ASP.NET MVC 3 Tools Update. It is similar to the Internet Application template,but the account management functions run against Windows accounts rather than the ASP.NET Membership system.

3. The Basic template: This template is pretty minimal. It still has the basic folders, CSS, and
MVC application infrastructure in place, but no more. Running an application created using
the Empty template just gives you an error message.

Why use Basic template? 
The Basic template is intended for experienced MVC developers
who want to set up and configure things exactly how they want them.

4.The Empty template: 
The Basic template used to be called the Empty template, but developers complained that it wasn’t quite empty enough. With MVC 4, the previous Empty
template was renamed Basic, and the new Empty template is about as empty as we can get.
It has the assemblies and basic folder structure in place, but that’s about it.

5. The Mobile Application template: The Mobile Application template is preconfigured with jQuery Mobile to jump-start creating a mobile only website. It includes mobile visual themes, a touch-optimized UI, and support for Ajax navigation.

6. The Web API template: ASP.NET Web API is a framework for creating HTTP services.
The Web API template is similar to the Internet Application template but is streamlined for Web API development. For instance, there is no user account management functionality, as Web API account management is often signify-cantly different from standard MVC account management. Web API functionality is also available in the other MVC project templates, and even in non-MVC project types.

What are the default Top level directories created when adding MVC4 application?
Default Top level Directories are:
DIRECTORY           PURPOSE
/Controllers            To put Controller classes that handle URL requests
/Models                 To put classes that represent and manipulate data and business objects
/Views                   To put UI template files that are responsible for rendering output like HTML.
/Scripts                  To put JavaScript library files and scripts (.js)
/Images                  To put images used in your site
/Content                 To put CSS and other site content, other than scripts and images
/Filters                    To put filter code.
/App_Data             To store data files you want to read/write

/App_Start             To put configuration code for features like Routing, Bundling, Web API.

What is namespace of asp.net mvc?
ASP.NET MVC namespaces as well as classes are located in assembly System.Web.Mvc.

Note: Some of the content has been taken from various books/articles.

What is System.Web.Mvc namespace?
This namespace contains classes and interfaces that support the MVC pattern for ASP.NET Web applications. This namespace includes classes that represent controllers, controller
factories, action results, views, partial views, and model binders.

What is System.Web.Mvc.Ajax namespace?
System.Web.Mvc.Ajax namespace contains classes that supports Ajax scripting in an ASP.NET MVC application. The namespace includes support for Ajax scripts and Ajax option settings as well.

What is System.Web.Mvc.Async namespace?
System.Web.Mvc.Async namespace contains classes and interfaces that support asynchronous actions in an ASP.NET MVC application.

What is System.Web.Mvc.Html namespace?
System.Web.Mvc.Html namespace  contains classes that help render HTML controls in an MVC application. This namespace includes classes that support forms, input controls, links, partial views, and validation.

0 comments:

Post a Comment