Isolation Means: Onetariga: Develop Web Application That Enables A Clean Separation of Code
Isolation Means: Onetariga: Develop Web Application That Enables A Clean Separation of Code
Isolation Means: Onetariga: Develop Web Application That Enables A Clean Separation of Code
Ans. ASP.NET MVC is an open source framework built on the top of Microsoft .NET Framework to
develop web application that enables a clean separation of code.
Ans. The main differences between ASP.NET Web Form and ASP.NET MVC are given below:
Because if we see in asp.net Webforms as we have various server control which generates large view
state to maintain state which make page heavy . If person having low bandwidth cannot access this
Heavy page. At this time we can use MVC where we have control over Generating HTMl
user
Development,Testing : The MVC components such as (Model, View and Controller) can be
developed in isolation. Because they are not directly depended on each other
Maintenance: All components logic is separated it make it easy for Maintenance in future.
The Controller
- Controller is a heart of the entire MVC architecture.
- The Controller as name tell it controls the application logic and interacts between model and view.
- The Controller take inputs from view and work with model and returns view.
View
It is only responsible for displaying the data that is received from the controller as the result. This also
transforms the model(s) into UI
Q7. Which one to choose between WCF and WEB API? Ans. The following points help you to choose
between WCF and WEB API: 1. Choose WCF when you want to create a service that should support special
scenarios such as one way messaging, message queues, duplex communication etc. 2. Choose WCF when
you want to create a service that can use fast transport channels when available, such as TCP, Named
Pipes, or maybe even UDP (in WCF 4.5), and you also want to support HTTP when all other transport
channels are unavailable. 3. Choose WEB API when you want to create resource-oriented services over
HTTP that can use the full features of HTTP (like URIs, request/response headers, caching, versioning,
various content formats). 4. Choose WEB API when you want to expose your service to a broad range of
clients including browsers, mobiles, iphone and tablets.
App_Data
App_Data folder can contain application data files like LocalDB, .mdf files, xml
files and other data related files. IIS will never serve files from App_Data
folder.
App_Start
App_Start folder can contain class files which will be executed when the
application starts. Typically, these would be config files like AuthConfig.cs,
BundleConfig.cs, FilterConfig.cs, RouteConfig.cs etc. MVC 5 includes
BundleConfig.cs, FilterConfig.cs and RouteConfig.cs by default.
Content
Content folder contains static files like css files, images and icons files. MVC 5
application includes bootstrap.css, bootstrap.min.css and Site.css by default.
Controllers
Controllers folder contains class files for the controllers. Controllers handles
users' request and returns a response. MVC requires the name of all controller
files to end with "Controller".
Models
Models folder contains model class files. Typically model class includes public
properties, which will be used by application to hold and manipulate
application data.
Views
Views folder contains html files for the application. Typically view file is a
.cshtml file where you write html and C# or VB.NET code.
Shared folder under View folder contains all the views which will be shared
among different controllers e.g. layout files.
Global.asax
Global.asax allows you to write code that runs in response to application level
events, such as Application_BeginRequest, application_start,
application_error, session_start, session_end etc.
Packages.config
Web.config
VB.NET Tutorial
5. Question 5. Explain The Advantages Of Asp.net Mvc Over Asp.net?
Answer :
o Provides a clean separation of concerns among UI (Presentation layer), model
(Transfer objects/Domain Objects/Entities) and Business Logic (Controller).
o Easy to UNIT Test.
o Improved reusability of model and views. We can have multiple views which can
point to the same model and vice versa.
o Improved structuring of the code.
ASP.NET Tutorial
11. Question 11. What Are Actions In Asp.net Mvc?
Answer :
Actions are the methods in Controller class which is responsible for returning the view or json
data. Action will mainly have return type : "ActionResult" and it will be invoked from
method : "InvokeAction()" called by controller.