Geeks With Blogs
Sankarsan Bose .NET Diaries ASP.NET MVC
Developing Custom RouteHandler
In my last post I had discussed about the key classes/interfaces involved in the ASP.NET MVC routing process.In this post we will develop sample route handler.To implement a route handler we need to implement the System.Web.Routing.IRouteHa... interface.The GetHttpHandler method of this interface should create the instance of IHttpHandler which in turn has to create the controller instance.Let us concentrate on this IHttpHandler implementation first.Take a close look at the code below: public class ......

Posted On Sunday, January 18, 2009 12:48 AM

While requesting some resource from an web server we normally type an URL like in the browser address bar.In this case the URL maps directly to a file residing in the server.Now say we have an URL like .In this case the web application has to be intelligent enough to parse the URL and find out which resource or request handler it will map to.This technique of parsing URL patterns and deciding on the requested resource is known as URL Routing. Along ......

Posted On Saturday, January 10, 2009 12:55 AM

Customizing ViewEngine in ASP.NET MVC
In an ASP.NET MVC application the request URI is of the following format {controller}/{action}/{id}.... on the controller name in the URI the ControllerFactory instantiates the appropriate Controller class and then based on the action in the URI the corresponding action method in the Controller is executed.Action method then dispatches the right view and by default the location of the views are in the path ~/Views/<Controller>/... how can we change this default behavior ......

Posted On Thursday, December 25, 2008 7:36 AM

Locating Views in ASP.NET MVC
In this post I will be discussing about the process of locating views in ASP.NET MVC and design of the classes & interfaces involved.In the controller class we normally write a method for each action to be performed and code in that method looks something like this: public ActionResult About() { ViewData["Title"] = "About Page"; return View(); } Note the method View() which is invoked at the last step.The method View() of System.Web.Mvc.Controller class returns System.Web.Mvc.ViewResult.Now let ......

Posted On Thursday, December 25, 2008 5:09 AM

ASP.NET MVC - Developing Custom ControllerFactory
ASP.NET MVC Framework has been around for quite sometime now.It has now moved to BETA from it's initial CTP versions.I am a very big fan of this framework for it's simplicity and extensibility.For the next few posts I would like discuss about the various extensibility points of this framework.In this post I will note down my observations about implementing a custom controller factory. When adding a controller to a ASP.NET MVC Web application we see that the Controller name must end with "Controller" ......

Posted On Tuesday, December 16, 2008 7:40 AM

Copyright © sankarsan | Powered by: