1.Difference
between HTML Controls and ASP.NET Standard Controls
-
S.No HTML ControlsASP.NET Standard Controls1All HTML Controls run at Client sideAll ASP.NET Controls run at Server side2 Can be made to run at Server side by adding runat=”server” attributeCan’t be made to run at Client side rather equivalent HTML code is generated on Rendering3 Rendering is NOT RequiredRendering is Required4 Execution is FASTExecution is SLOW5 Don’t contain any class for the ControlsContains Separate class for each Controls6 Don’t support Object Oriented Programming featuresSupports Object Oriented Programming Features7 Don’t provide STATE MANAGEMENTProvides STATE MANAGEMENT
-
S.No Response.RedirectServer.Transfer1Used to redirect to any webpage in any websiteUsed to redirect to any webpage in current website only2 Can be used to pass the required values from Source Page to Target Page while redirectingCan’t be used to pass the required values from Source Page to Target Page while redirecting3 Execution is SlowExecution is Fast4 Target page address appears within the address barTarget page address doesn’t appears within the address bar5 Refreshing of the page doesn’t cause any errorRefreshing of the page causes error
-
S.No ASP.NETASP.NET MVC1You need .NET framework to install ASP.NET.You need .NET framework & ASP.NET to Install MVC.2 Supports Code behind page coding & Inline codingSupports 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 PagesPages are called Views4 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 practice5 We use Viewstate concept extensivelyThere is no Viewstate for view. There is no state of the controls. But state of the entire page can be maintained by a feature ModelBinders6 Every Page is inherited from System.Web.UI.ViewPageEvery 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 pagesYou 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 application13 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 changedYou 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 pagesYou 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 pagesURLS formats drive the inputs to the requests. You can also have querystrings18 Related Pages are separated by folderRelated 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 developmentMVC 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