Posts

Showing posts from 2016

Difference between array, arraylist, List, Hashtable, Dictionary and SortedList in c#

Basic difference is that arrays are of fixed size. Whereas an ArrayList implements the list data structure and can dynamically grow. While arrays would be more performance that a list, a list would be far more flexible since you don't need to know the required size initially. Array - represents an old-school memory array - kind of like a alias for a normal type[] array. Can enumerate. Can't grow automatically. I would assume very fast insertion, retrieve and speed. ArrayList - automatically growing array. Adds more overhead. Can enum., probably slower than a normal array but still pretty fast. These are used a lot in .NET List - one of my favorites - can be used with generics, so you can have a strongly typed array, e.g. List . Other than that, acts very much like ArrayList. Hashtable - plain old hashtable. O(1) to O(n) worst case. Can enumerate the value and keys properties, and do key/val pairs. Dictionary - same as above only strongly typed via generics, such a...

What are Scaffold templates in ASP.Net MVC?

Scaffolding in ASP.NET MVC is used to generate the Controllers,Model and Views for create, read, update, and delete CRUD functionality in an application. The scaffolding will be knowing the naming conventions used for models and controllers and views. Explain the types of Scaffoldings. Below are the types of scaffoldings : Empty Create Delete Details Edit List

What are AJAX Helpers in ASP.Net MVC?

AJAX Helpers are used to create AJAX enabled elements like as Ajax enabled forms and links which performs the request asynchronously and these are extension methods of AJAXHelper class which exists in namespace - System.Web.ASP.Net MVC. Below are the options in AJAX helpers : Url : This is the request URL. Confirm : This is used to specify the message which is to be displayed in confirm box. OnBegin : Javascript method name to be given here and this will be called before the AJAX request. OnComplete : Javascript method name to be given here and this will be called at the end of AJAX request. OnSuccess - Javascript method name to be given here and this will be called when AJAX request is successful. OnFailure - Javascript method name to be given here and this will be called when AJAX request is failed. UpdateTargetId : Target element which is populated from the action returning HTML

Explain Page Life Cycle in asp.net.

Following are the Page Life Cycle in asp.net. • InIt: Before constructing the control PreInIt then each control Instantiated set to Innitial state Added to Control State. • LoadViewState: Lost state of the controls restored from viewstate values. • Load: User Code runs, tests it's postback conditions to databind first value. • PostBack Data: Posted Data is passed to its associated controls. • PostBack Events: Events are fixed for controls in tree order, except the event that caused the post it's fired last. • Pre Render: Creat Child Controls, ensure contros are ready to render. • Save ViewState: Controls save current state (if different than innitital values) • Render: Each control Render itself to the Response. • Dispose: Page and all controls are destroyed.

Explain the methods used to render the views in ASP.Net MVC?

Below are the methods used to render the views from action - View() : To return the view from action. PartialView() : To return the partial view from action. RedirectToAction() : To Redirect to different action which can be in same controller or in different controller. Redirect() : Similar to "Response.Redirect()" in webforms, used to redirect to specified URL. RedirectToRoute() : Redirect to action from the specified URL but URL in the route table has been matched.

Explain the advantages of ASP.Net MVC over ASP.NET web form?

MVC Provides a clean separation of concerns among UI (Presentation layer), model (Transfer objects/Domain Objects/Entities) and Business Logic (Controller). Easy to UNIT Test in MVC. Improved reusability of model and views. We can have multiple views which can point to the same model and vice versa. Improved structuring of the code.

Difference between WCF and Web Services?

Below are the main differences between the WCF and Web Service:   Web Service : a.  Can be hosted in IIS only b.  Only two types of operations affects- One-Way, Request-Response c.  To serialize the data use System.Xml.Serialization d.  To encode the data use- XML 1.0, MTOM, DIME, Custom e. Web Service can be accessed through HTTP channel.   WCF service : a.  Can be hosted in IIS, Self Hosting, WAS, Windows Services etc b.  Three types of operations affects- One-Way, Request-Response and Duplex c.  To serialize the data use System.Runtimel.Serialization d.  To encode the data use- XML 1.0, MTOM,Binary, Custom e.  WCF Service can be accessed through HTTP, TCP, Named pipes, MSMQ,P2P etc.

Why to use UpdatePanel control in AJAX ASP.NET?

AJAX is a client side technology and it supports asynchronous communication between client and server. If the part of page need to be refreshed, then we can use this Update panel control, which uses AJAX request and does not harm the other part of the page. Using Update Panel improves the user experience of the page since it does not refresh the whole page.

What is the difference between cache object and session object?

Cache – This improves the performance by minimizing the database hits to fetch the data.  It instead stores the data in cache. So cache will be checked first for data and if it is not found then go to database to get the data. Session – Session will be created to store the details of the user for capturing the user’s specific actions. Session will be killed or it will be expired in 20 minutes.

Performance wise which is better, Session or ViewState?

For large amount of data, Session will be an efficient way to go. When session is not used, set it to null for memory overhead but this cannot be done in all the cases. Once the session timeout happened it automatically set to null. Default timeout is 20 minutes. In Viewstate, all data will be stored in HTML hidden fields. For large amount of data, it would give performance issues. Ideal size of viewstate should not be more than 20-30% of page size. So for less data viewstate will be an ideal solution.

Which are the different IIS isolation levels in ASP.NET?

IIS has three level of isolation – LOW (IIS process) - In this, ASP.NET application and main IIS process run in same process. So, if any application crashes it will adversely affect the others too. Medium (Pooled) - In Medium pooled scenario the IIS and web application run in different process. So in this case there will be two processes process1 and process2. Process1 runs the IIS process and Process2 runs the Web application. High (Isolated) - Here every process runs under it’s own process. This consumes heavy memory but has highest reliability.

Explain the components of web form in ASP.NET?

Server controls - The server controls are Hypertext Markup Language (HTML) elements that include a runat=server attribute. These controls provide automatic state management and server-side events and respond to the user events by executing event handler on the server. HTML controls - These controls also respond to the user events but the events processing happen on the client machine. Data controls - Data controls allows us to connect to the database, execute command and retrieve data from database.

What’s the difference between Literal control and Label control in Asp.Net?

Label control is rendered as when rendered as HTML. Label control styles like font size, font color etc can be changed with very less effort. Javascript or JQuery also can access the label control very easily. Literal control rendered as it is. Literal control cannot be styled easily like label control because it does not render in enclosed HTML tags. Javascript or Jquery will not be able to access literal control because while rendering it would not have ID in spite of giving the ID in mark up.

What is cross-page posting in asp.Net?

Server.Transfer() method is used for posting the data from one page to another. In cross page posting, data collected from different pages and will be displayed in single page. So, for doing this we need to set “ PostBackUrl ” property of the control, in which target page is specified and in target page we can use “ PreviousPage ” property. For doing this we need to set the directive - @PreviousPageType . Previous page control can be accessed from the method – “ FindControl() ”.

What is difference between Data list, Grid view and Repeater in asp.Net?

All these controls have many things in common like Data Source Property, Data Bind Method ItemDataBound and ItemCreated . When Data Source Property of a Grid view is assigned to a Dataset then each Data Row present in the Data Row Collection of Data Table is assigned to a corresponding DataGridItem and this is same for the rest of the two controls also. But The HTML code generated for a Grid view has an HTML TABLE element created for the particular Data Row and it’s a Table form representation with Columns and Rows. For a Data list it’s an Array of Rows and based on the Template Selected and the RepeatColumn Property value we can specify how many Data Source records should appear per HTML row. In short in Grid view we have one record per row, where as in data list we can have five or six rows per row.    In Repeater Control the data records which are to be displayed depends upon the Templates specified and the only HTML generated is the due to the Templates...

What is smart navigation in Asp.Net?

Using the Page.SmartNavigation property, we can enable smart navigation. When we set the property - Page.SmartNavigation to true, the following features are enabled for smart navigation. Scroll position of a Web page will be maintained after postback . Element which focus on a Web page is maintained during navigation. Most recent Web page state is only retained in the Web browser history folder. Flicker effect which could occur on a Web page during navigation will be minimized.

What is IIS? Why is it used?

Internet Information Services ( IIS ) is created by Microsoft to provide Internet-based services to ASP.NET Web applications. It makes your system to work as a Web server and provides the functionality to develop and deploy Web applications on the server. IIS handles the request-response cycle on the Web server. It offers the service of SMTP and front-page server extensions. As you know SMTP is used to send emails and use FrontPage server extensions to get the dynamic features of IIS , such as form handlers.

How many types of validation controls are provided by ASP.NET ?

There are FIVE types of validators in ASP.NET and they are – RequiredFieldValidator - It checks whether the control have any value or not. It is used, when you want the control not to be empty. RangeValidator - It checks, if the value in validated control is in that specific range. Eg: Range of Date Birth. CompareValidator - It checks that the value in controls should match the value in other control. Eg : Password and Retype Passwords. RegularExpressionValidator - When we want the control value that matches a specific regular expression. Eg : Checking for valid Email ID. CustomValidator - It is used to define User Defined validation.

What are the various ways of authentication techniques in ASP.NET?

There are basically three types of authentication modes in ASP.NET – Windows Authentication – windows authentication uses our system credentials for the authentication purpose.  Forms Authentication – This is a form based authentication. Login Control in ASP.NET supports this kind of authentication. Passport Authentication - Passport authentication lets you to use Microsoft’s passport service to authenticate users of your application.

What are the State Management options in ASP.NET ?

There are two types of state management in asp.net i.e Client-side state management and Server-side state management Client-side state management - This maintains information on the client’s machine using either of the following options – Cookies - Cookie is a small sized text file on the client machine either in the client’s file system or memory of client browser session. View State - Each page and control on the page has View State property. This allows automatic retention of page and control’s state between each trip to server. Query string - Query strings can maintain limited state information. Data has been passed from one page to another with the URL, but you can send limited size of data with the URL. Server-side state management - This mechanism retains state in the server. Below are the options to achieve it - Application State - The data stored in the application object can be shared by all the sessions of the application. Session State - Session State st...

What is Common Language Runtime or CLR

As part of Microsoft's .NET Framework, the Common Language Runtime ( CLR ) is programming that manages the execution of programs written in any of several supported languages , allowing them to share common object-oriented class es written in any of the languages . CLR handles the compilation and execution of .NET programs. CLR uses JIT(Just in time)  and compiles the IL code to machine code and then executes.  Below are the list of responsibilities of Common Language Run-time. Garbage Collection Code Verification Code Access Security Intermediate language -to-native translators and optimizer’s

What is the application event handlers in ASP.NET

Application event handlers are located in global.asax file of the asp.net application Below are the application event handlers in sequence of their execution - Application_Start - Fired when the first user visits a page of the application or first resource is requested from the server. A web application starts, when a browser requests a page of the application for the first time. The request will be received by the IIS which then starts ASP.NET worker process. The worker process then allocates a process space to the assembly and loads it. Application_End - Fired when there are no more users of the application. Application_BeginRequest - Fired at the beginning of each request to the server. Application_EndRequest - Fired at the end of each request to the server. Session_Start - Fired when any new user visits. Session_End - Fired when the users stop requesting pages and their session times out.

What is an HttpHandler and its use in ASP.NET

In the simplest terms, A handler is responsible for fulfilling requests from a browser. In ASP.NET HttpHandler is a class that implements the System.Web.IHttpHandler interface. ASP.NET HTTPHandlers are responsible for intercepting requests made to your ASP.NET web application server. They run as processes in response to a request made to the ASP.NET Site. The most common handler is an ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. ASP.NET offers a few default HTTP handlers : Page Handler (.aspx): handles Web pages User Control Handler (.ascx): handles Web user control pages Web Service Handler (.asmx): handles Web service pages Trace Handler (trace.axd): handles trace functionality You can create your own custom HTTP handlers that render custom output to the browser. Typical scenarios for HTTP Handlers in ASP.NET are for example Delivery of dynamically created images (chart...

Change Aadhaar Card details online by following 3 Easy Steps

You can change your AADHAAR details online by following 3 easy steps. You can change the below list of data in your AADHAAR card, using UIDAI  Portal : Name Address Mobile Phone Number Gender Date Of Birth Follow below steps to change your details Login to https://ssup.uidai.gov.in/web/guest/update   and enter your AADHAAR No, you will receive the One Time Pin on your registered mobile no Submit the details by selecting appropriate options Upload self attested soft copy supporting file and submit the final details After submission of the details you will receive AADHAAR card change request number. Save the change request number to track the request. You can track your request from below link https://ssup.uidai.gov.in/web/guest/check-status

Difference between onload() and document.ready() function used in jQuery?

We can add more than one document.ready() function in a page.   we can have only one onload function.   Document.ready() function is called as soon as DOM is loaded.   body.onload() function is called when everything (DOM, images)gets loaded on the page.

How to get the server response from an AJAX request using Jquery?

When invoking functions that have asynchronous behavior We must provide a callback function to capture the desired result. This is especially important with AJAX in the browser because when a remote request is made, it is indeterminate when the response will be received.  Below an example of making an AJAX call and alerting the response (or error):      $.ajax({          url: 'pcdsEmpRecords.php',          success: function (response) {              alert(response);          },          error: function (xhr) {              alert('Error! Status = ' + xhr.status);          }      });

What is the difference between jquery.size() and jquery.length?

Jquery.size() and jquery.length both returns the number of element found in the object. But, jquery.length is faster than jquery.size() because size() is a method but length is a property. Q

What is the use of jquery .each() function?

Basically, the jQuery .each() function is used to loop through each element of the target jQuery object. Very useful for multi element DOM manipulation, looping arrays and object properties.   Example:-  In this example alert box will open 3 times because dom contain 3 tags  <.ul>   Coffee   Milk   Soda  <.ul>

How to select combobox selected value and text using Jquery?

Example: var StateID = $("#StateCbx").val(); // Or you can use it $("#iStateID").val(); var StateName = $("#StateCbx option:selected").text(); alert("Selected combobox text is= " + StateName + " and value is= " + StateID);

When can you use jQuery?

JQuery can be used to perform   1.Call methods on specific events   2.Traverse the documents   3.For apply CSS   4.Manipulation purpose and   5.To add effects too.   6.For apply animations   7.For give atractive look (dialogbox etc)   8.For asynchronous calls ($.ajax())

Name any four paremeter of Jquery ajax method?

url : Specifies the URL to send the request to. Default is the current page   type : Specifies the type of request. (GET or POST)   data : Specifies data to be sent to the server   cache: A Boolean value indicating whether the browser should cache the requested pages. Default is true beforeSend(xhr): A function to run before the request is sent

What is Jquery $.ajax() method

The Jquery ajax() method is used to perform an AJAX (asynchronous HTTP) request. HTTP request can be get request or post request.

How do we make HTTP get and post calls in Angular?

To make HTTP calls we need to use the “$http” service of Angular. In order to use the http services you need to make provide the “$http” as a input in your function parameters as shown in the below code. function CustomerController($scope,$http) {  $scope.Add = function()  {             $http({ method: "GET", url: " http://localhost:8438/SomeMethod "     }).success(function (data, status, headers, config)   {                    // Here goes code after success   }  } } “$http” service API needs atleast three things:- •First what is the kind of call “POST” or “GET”. •Second the resource URL on which the action should happen. •Third we need to define the “success” function which will be executed once we get the response from the server. $http({ method: "GET", url: " http://localhost:8438/SomeM...

Explain $scope in AngularJs?

“$scope” is an object instance of a controller. “$scope” object instance get’s created when “ng-controller” directive is encountered. For example in the below code snippet we have two controllers “Function1” and “Function2”. In both the controllers we have a “ControllerName” variable. function Function1($scope) { $scope.ControllerName = "Function1";        } function Function2($scope) { $scope.ControllerName = "Function2"; } Now to attach the above controllers to HTML UI we need to use “ng-controller” directive. For instance you can see in the below code snippet how “ng-controller” directive attaches “function1” with “div1” tag and “function2” with “div2” tag. Instance of {{ControllerName}} created Instance of {{ControllerName}} created So this is what happens internally. Once the HTML DOM is created Angular parser starts running on the DOM and following are the sequence of events:- •The parser first finds “ng-controller” directive which is pointing t...

What are expressions in Angular?

Angular expressionsare unit of code which resolves to value. This code is written inside curly braces “{“. Below are some examples of angular expressions:- The below expression adds two constant values. Hide   Copy Code {{1+1}} The below expression multiplies quantity and cost to get the total value. Hide   Copy Code The value total cost is {{ quantity * cost }} The below expression displays a controller scoped variable. The value of Customer code is {{CustomerCode}} The value of Customer code is {{CustomerCode}}

What are controllers and need of ng-controller and ng-model in Angular?

“Controllers” are simple javascript function which provides data and logic to HTML UI. As the name says controller they control how data flows from the server to HTML UI. For example below is simple “Customer” controller which provides data via “CustomerName” and “CustomerCode” property and Add/ Update logic to save the data to database. function Customer($scope) {         $scope.CustomerName = "Shiv";         $scope.CustomerCode = "1001";         $scope.Add = function () {         }         $scope.Update = function () {         } } “ng-controller” is a directive.Controllers are attached to the HTML UI by using the “ng-controller” directive tag and the properties of the controller are attached by using “ng-model” directive. For example below is a simple HTML UI which is attached t...

Explain Directives in AngularJs

Directives are attributes decorated on the HTML elements. All directives start with the word “ng”. As the name says directive it directs Angular what to do. For example below is a simple “ng-model” directive which tells angular that the HTML textbox “txtCustomerName” has to be binded with the “CustomerName” property. Some of the most commonly used directives are ng-app,ng-controller and ng-repeat

What are controllers and need of ng-controller and ng-model in AngularJs?

“Controllers” are simple javascript function which provides data and logic to HTML UI. As the name says controller they control how data flows from the server to HTML UI. For example below is simple “Customer” controller which provides data via “CustomerName” and “CustomerCode” property and Add/ Update logic to save the data to database. function Customer($scope) {         $scope.CustomerName = "Shiv";         $scope.CustomerCode = "1001";         $scope.Add = function () {         }         $scope.Update = function () {         } } “ng-controller” is a directive.Controllers are attached to the HTML UI by using the “ng-controller” directive tag and the properties of the controller are attached by using “ng-model” directive. For example below is a simple HTML UI which is attached t...

Explain Directives in AngularJs?

Directives are attributes decorated on the HTML elements. All directives start with the word “ng”. As the name says directive it directs Angular what to do. For example below is a simple “ng-model” directive which tells angular that the HTML textbox “txtCustomerName” has to be binded with the “CustomerName” property. Hide  Some of the most commonly used directives are ng-app,ng-controller and ng-repeat

What are the 3 things that are needed to specify a route in mvc?

following are the 3 things that are needed to specify a route in mvc : 1. URL Pattern - You can include placeholders in a URL pattern so that variable data can be passed to the request handler without requiring a query string. 2. Handler - The handler can be a physical file such as an .aspx file or a controller class. 3. Name for the Route - Name is optional.

Name a few different return types of a controller action method?

The following are just a few return types of a controller action method. In general an action method can return an instance of a any class that derives from ActionResult class. 1. ViewResult 2. JavaScriptResult 3. RedirectResult 4. ContentResult 5. JsonResult

What are the advantages of ASP.NET MVC?

1. Extensive support for TDD. With asp.net MVC, views can also be very easily unit tested. 2. Complex applications can be easily managed 3. Seperation of concerns. Different aspects of the application can be divided into Model, View and Controller. 4. ASP.NET MVC views are light weight, as they donot use viewstate.

Can we have a Custom View Engine in MVC ?

Yes we have a Custom View Engine in MVC , by implementing the IViewEngine interface or by inheriting from the VirtualPathProviderViewEngine abstract class.

What is the significance of NonActionAttribute in MVC

In general, all public methods of a controller class are treated as action methods. If you want prevent this default behaviour, just decorate the public method with NonActionAttribute.

What is the use of web API ? Why Web API needed, If you have already RESTful services using WCF ?

we can still develop the RESTful services with WCF, but there are two main reasons that prompt users to use Web API instead of RESTful services. ◾ASP.NET Web API is included in ASP.NET MVC which obviously increases TDD (Test Data Driven) approach in the development of RESTful services. ◾For developing RESTful services in WCF you still needs lot of config settings, URI templates, contract’s & endpoints which developing RESTful services using web API is simple.

What is Web API ‘s in Asp.Net MVC 4 ?

◾Web API is a new framework for consuming & building HTTP Services. ◾Web API supports wide range of clients including different browsers and mobile devices. ◾It is very good platform for developing RESTful services since it talk’s about HTTP.

What is Attribute Routing in MVC?

ASP.NET Web API supports this type routing. This is introduced in MVC5. In this type of routing, attributes are being used to define the routes. This type of routing gives more control over classic URI Routing. Attribute Routing can be defined at controller level or at Action level like – [Route(“{action = TestCategoryList}”)] - Controller Level [Route(“customers/{TestCategoryId:int:min(10)}”)] - Action Level Just add the method – “MapMvcAttributeRoutes()” to enable attribute routing as shown below public static void RegistearRoutes(RouteCollection routes) { routes.IgnoareRoute("{resource}.axd/{*pathInfo}"); //enabling attribute routing routes.MapMvcAttributeRoutes(); //convention-based routing routes.MapRoute ( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Customer", action = "GetCustomerList", id = UrlParameter.Optional } ); }

What are the advantages of MVC over ASP.NET?

Following are advantages of MVC over ASP.NET Provides a clean separation of concerns among UI (Presentation layer), model (Transfer objects/Domain Objects/Entities) and Business Logic (Controller). Easy to UNIT Test. Improved reusability of model and views. We can have multiple views which can point to the same model and vice versa. Improved structuring of the code.

What are the namespace classes used in ASP.NET MVC?

-All the namespaces and classes used for ASP.NET MVC reside in the System.Web.Mvc assembly. -System.Web.Mvc namespace This namespace provides classes and interfaces that support the MVC pattern for ASP.NET Web applications. This namespace also contains classes that manage controllers, controller factories, partial views, action results, views and model binders. -System.Web.Mvc.Ajax namespace This namespace provides classes that support Ajax scripts in an ASP.NET MVC application. The namespace also provides support of Ajax scripts and Ajax option settings. -System.Web.Mvc.Async namespace This namespace provides classes and interfaces that support asynchronous actions in an ASP.NET MVC application. -System.Web.Mvc.Html namespace This namespace provides classes that help in rendering HTML controls in an MVC application. The namespace contains classes providing forms, input controls, links, partial views, and validation support

What is Repository Pattern in ASP.NET MVC?

-Repository pattern is used as a default entity operation that allow the decoupling of the components used for presentation. -Repository pattern allows easy testing in the form of unit testing and mocking. -Repository pattern will have the proper infrastructure services to be used in the web applications. -It uses the mechanism of encapsulating that provides storage, retrieval and query for the implementation of the repository. -Repository patterns are hard coded in the application that is to be used in ASP.NET MVC architecture -Repository pattern is useful for decoupling entity operations form presentation, which allows easy mocking and unit testing. -The Repository will delegate to the appropriate infrastructure services to get the job done. Encapsulating in the mechanisms of storage, retrieval and query is the most basic feature of a Repository implementation. -Repository pattern is useful for decoupling entity operations form presentation, which allows easy mocking and unit testing...

What is Bootstrap in MVC5?

Bootstrap (a front-end framework) is an open source collection of tools that contains HTML and CSS-based design templates along with Javascript to create a responsive design for web applications. Bootstrap provides a base collection including layouts, base CSS, JavaScript widgets, customizable components and plugins. Project Template in ASP.NET MVC5 is now using bootstrap that enhances look and feel with easy customization. Bootstrap version 3 is added to ASP.NET MVC5 template

What is a ViewModel in ASP.NET MVC?

A ViewModel basically acts as a single model object for multiple domain models, facilitating to have only one optimized object for View to render. Below diagram clearly express the idea of ViewModel in ASP.NET MVC: There are multiple scenarios where using ViewModel becomes obvious choice. For example: ◾Parent-Child View Scenario ◾Reports where often aggregated data required ◾Model object having lookup data ◾Dashboards displaying data from multiple sources

What is a ViewEngine in ASP.NET MVC?

“View Engine in ASP.NET MVC is used to translate our views to HTML and then render to browser.” There are few View Engines available for ASP.NET MVC but commonly used View Engines are Razor, Web Forms/ASPX, NHaml and Spark etc. Most of the developers are familiar with Web Forms View Engine (ASPX) and Razor View Engine. ◾Web Form View Engine was with ASP.NET MVC since beginning. ◾Razor View Engine was introduced later in MVC3. ◾NHaml is an open source view engine since 2007. ◾Spark is also an open source since 2008.

What is a ViewEngine in ASP.NET MVC?

“View Engine in ASP.NET MVC is used to translate our views to HTML and then render to browser.” There are few View Engines available for ASP.NET MVC but commonly used View Engines are Razor, Web Forms/ASPX, NHaml and Spark etc. Most of the developers are familiar with Web Forms View Engine (ASPX) and Razor View Engine. ◾Web Form View Engine was with ASP.NET MVC since beginning. ◾Razor View Engine was introduced later in MVC3. ◾NHaml is an open source view engine since 2007. ◾Spark is also an open source since 2008.

request flow in ASP.NET MVC framework

Request flow for ASP.NET MVC framework is as follows:  Request hits the controller coming from client. Controller plays its role and decides which model to use in order to serve the request. Further passing that model to view which then transforms the model and generate an appropriate response that is rendered to client.

Core features of ASP.NET MVC

Core features of ASP.NET MVC framework are: ◾Clear separation of application concerns (Presentation and Business Logic). It reduces complexity that makes it ideal for large scale applications where multiple teams are working. ◾It’s an extensible as well as pluggable framework. We can plug components and further customize them easily. ◾It provides extensive support for URL Routing that helps to make friendly URLs (means friendly for human as well as Search Engines). ◾It supports for Test Driven Development (TDD) approach. In ASP.NET WebForms, testing support is dependent on Web Server but ASP.NET MVC makes it independent of Web Server, database or any other classes. ◾Support for existing ASP.NET features like membership and roles, authentication and authorization, provider model and caching etc.

Difference between ASP.NET MVC and ASP.NET WebForms?

ASP.NET Web Forms uses Page controller pattern approach for rendering layout, whereas ASP.NET MVC uses Front controller approach. In case of Page controller approach, every page has its own controller i.e. code-behind file that processes the request. On the other hand, in ASP.NET MVC, a common controller for all pages processes the requests.

Explain MVC (Model-View-Controller) in general?

MVC (Model-View-Controller) is an architectural software pattern that basically decouples various components of a web application. By using MVC pattern, we can develop applications that are more flexible to changes without affecting the other components of our application. ◾ “Model”, is basically domain data. ◾ “View”, is user interface to render domain data. ◾ “Controller”, translates user actions into appropriate operations performed on model.