8.10.2012

ASP.NET Difference FAQs-8

1.Difference between HTML Controls and ASP.NET Standard Controls
S.No
HTML Controls
ASP.NET Standard Controls
1
All HTML Controls run at Client side
All ASP.NET Controls run at Server side
2
Can be made to run at Server side by adding runat=”server” attribute
Can’t be made to run at Client side rather equivalent HTML code is generated on Rendering
3
Rendering is NOT Required
Rendering is Required
4
Execution is FAST
Execution is SLOW
5
Don’t contain any class for the Controls
Contains Separate class for each Controls
6
Don’t support Object Oriented Programming features
Supports Object Oriented Programming Features
7
Don’t provide STATE MANAGEMENT
Provides STATE MANAGEMENT
2.Difference between Response.Redirect and Server.Transfer
S.No
Response.Redirect
Server.Transfer
1
Used to redirect to any webpage in any website
Used to redirect to any webpage in current website only
2
Can be used to pass the required values from Source Page to Target Page while redirecting
Can’t be used to pass the required values from Source Page to Target Page while redirecting
3
Execution is Slow
Execution is Fast
4
Target page address appears within the address bar
Target page address doesn’t appears within the address bar
5
Refreshing of the page doesn’t cause any error
Refreshing of the page causes error
3.Difference between ASP.NET and ASP.NET MVC
S.No
ASP.NET
ASP.NET MVC
1
You need .NET framework to install ASP.NET.
You need .NET framework & ASP.NET to Install MVC.
2
Supports Code behind page coding & Inline coding
Supports both Code behind page coding & Inline coding but, we should not use code behind as a practice because view should not perform any logic.
3
Pages are called Pages
Pages are called Views
4
There is a Life cycle for every page.
There is tailored lifecycle of the page. By default you won't see the events when you create the Views but, you can add the Page Load event by in a script server tag. Again its not a good practice
5
We use Viewstate concept extensively
There is no Viewstate for view. There is no state of the controls. But state of the entire page can be maintained by a feature ModelBinders
6
Every Page is inherited from System.Web.UI.ViewPage
Every Page is inherited from System.Web.Mvc.ViewPage. View page is inherited from System.Web.UI.Page.
7
You don't have the strongly typed pages
You can create the Strongly typed Views using generics. It means, you can pass the object (Model) to the view page from the controller.
8
Has lot of inbuilt Controls that support RAD.
We cannot use the ASP.NET controls because they don't support the ViewState and Postback.

We have inbuilt methods called HTML Helper methods. These methods just create the required HTML in the response stream. You can create the user controls.
9
Has the limited control over the HTML being generated by various controls.
Since we have no controls and are writing HTML we have control over the markup.
10
Logic is not completely modularized in pages.
Logic is modularized in methods called Action methods of the controller.
11
Difficult to test the UI Logic using unit tests.
MVC is designed to unit test every part of the application. It strongly supports the TDD approach.
12
Doesn't support clean or search engine friendly URL's . ASP.NET 4 has the routing module or else
we need to use URL rewrites.
Support clean or search engine friendly URL's
You can design to support the REST based resources in application
13
Code behind supports only one aspect of separation of concerns.
Web request finally will reach the controller. Requests never reach Views. Web user cannot identify a specific view on the server.
14
Web requests are reached directly to the intended page. Web users can identify the pages on the server.
Web request finally will reach the controller. Requests never reach Views. Web user cannot identify a specific view on the server.
15
If you rename the web pages the URL is changed
You don't need to change the URL, even if you change the Controller and the View.
16
URLS are determined by the folder structure of the pages
You have to define the URL formats which are called Routes. Framework will try to match the URL with all the defined routes in an order.
Framework will hand over the request to the corresponding route Handler.
17
Query string are used as small inputs to the pages
URLS formats drive the inputs to the requests. You can also have querystrings
18
Related Pages are separated by folder
Related Views are written under controller. And for each controller we need to create a folder for all its views.
19
We have ASP.NET AJAX Framework and AJAX server side controls to support AJAX page development
MVC has some AJAX features but internally it uses the ASP.NET AJAX script libraries. So we have to manually include the libraries in the project. No support of AJAX Server side controls.
20
File extensions in IIS are mapped to ASP.NET isapi dll and in web.config they are mapped to corresponding file HTTPHandlers.
There are no file extensions for MVC. If deployed in IIS7 Internally it will use the MVC UrlRoutingModule to route the request to the MVC framework.
21
All the Page requests are handled by PageFactory Handler.
Each Route has the option to use a default Route handler or custom handler. So all the page requests are handled by Route handles.
22
It's difficult to modify the internal behavior of the core ASP.NET components.
It's designed to modify or replace the internal components. It supports the Plug-in structure

Example: - ASPX Pages are used to render the HTML. You can configure to not to use ASP.NET pages and use different view engines.


There are many view engines available in market or you can create your own view engine.

No comments:

Post a Comment