Castle.Windsor case sensitive urls with asp.net MVC?

by volkanuzun 12/28/2008 9:31:00 AM

I am completely a newbie when it comes to using ioc frameworks. For one my hobby projects i was working on using asp.net mvc, i decided to use castle.windsor for the dependency injection. I created a class deriving from IControllerFactory as below:

internal class WindsorControllerFactory : IControllerFactory

    {

        WindsorContainer container;

 

        public WindsorControllerFactory()

        {

            container = new WindsorContainer(new XmlInterpreter(new ConfigResource(("castle"))));

            // Also register all the controller types as transient

            foreach (Type t in Assembly.GetExecutingAssembly().GetTypes())

                if (typeof(IController).IsAssignableFrom(t)) // Is it a controller?

                    container.AddComponentWithLifestyle(t.Name, t,

                    LifestyleType.Transient);

        }

 

        #region IControllerFactory Members

 

        public IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)

        {

            string name = controllerName + "Controller";

            return container.Resolve<IController>(name);

        }

 

        public void ReleaseController(IController controller)

        {

            IDisposable disp = controller as IDisposable;

            if (disp != null)

                disp.Dispose();

        }

 

        #endregion

    }

 

The interesting thing is my urls become case sensitive suddenly :) so /home/list is not matching whereas /Home/List is matching route. Fix? dont know yet hehe 

Tags:

mvc

Comments

1/18/2009 6:50:35 AM

Busby SEO Test

Yeah.. this is the code that i want

Busby SEO Test us

1/25/2009 9:25:06 PM

Google Dance for Busby SEO Test in this Chinese New Year 2009

Thanks for the great code.. thanks.

Google Dance for Busby SEO Test in this Chinese New Year 2009 us

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



About the author

Volkan Uzun




E-mail me Send mail

Twitter

Calendar

<<  July 2009  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Flickr Badge

www.flickr.com
This is a Flickr badge showing public photos from volkanuzun. Make your own badge here.

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009

Sign in