View: It contains the layout page. Before any view is rendered, viewstart page is rendered. View might have markup tags like body, html, head, title, meta etc. View is not lightweight as compare to Partial View. Partial View: It does not contain the layout page. Partial view does not verify for a viewstart.cshtml.We cannot put common code for a partial view within the viewStart.cshtml.page. Partial view is designed specially to render within the view and just because of that it does not consist any mark up. We can pass a regular view to the RenderPartial method.
Singleton : 1. Singleton class contains both static and non-static members 2. You can create instance of Singleton class. 3. You can implement inheritance. 4. You can clone a singleton class object. 5. Singleton class object creates in Heap memory. Static Class: 1. Static class contains only static members. 2. You can't create instance of Static class. 3. Once you declare a class as static you can't implement inheritance. 4. You can't clone static class object. 5. Static class object creates in stack memory.
Routing is a mechanism to process the incoming url that is more descriptive and give desired response. In this case, URL is not mapped to specific files or folder as was the case of earlier days web sites. There are two types of routing (after the introduction of ASP.NET MVC 5). Convention based routing: to define this type of routing, we call MapRoute method and set its unique name, url pattern and specify some default values. Attribute based routing: to define this type of routing, we specify the Route attribute in the action method of the controller. Routing is the URL pattern that is mappped together to a handler,rounting is responsible for incoming browser request for particular MVC controller. In other ways let us say routing help you to define a URL structure and map the URL with controller. There are three segments for routing that are important, ControllerName ActionMethodName Parammeter i.e: ControllerName/ActionMethodName/{ParamerName} and als...
Comments
Post a Comment