+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / URL routing broken in 5.1 upgrade

URL routing broken in 5.1 upgrade

3 posts, 0 answered
  1. Chris Hayward
    Chris Hayward avatar
    36 posts
    Registered:
    17 Dec 2009
    06 Aug 2012
    Link to this post
    Been using  Bootstrapper_Initialized in our global.asax to use some of our own custom routes to go along side sitefinity's.

    been working great for the past year or so, but its broken today after 5.1 upgrade.

    We're doing whats almost identical on this thread:
    http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/custom-routing.aspx


    error we are receiving after 5.1 upgrade is:

    this line:
    var routes = (System.Web.Routing.RouteCollection)args.Data;
    
    
    
    Unable to cast object of type 'System.Linq.EnumerableQuery`1[System.Web.Routing.RouteBase]' to type 'System.Web.Routing.RouteCollection'.


    any advice is appreciated 
  2. Chris Hayward
    Chris Hayward avatar
    36 posts
    Registered:
    17 Dec 2009
    09 Aug 2012
    Link to this post
    bumping

    How can i extend my own routes along side sitefinity 5.1?

    thx
  3. LBrinley
    LBrinley avatar
    59 posts
    Registered:
    29 Dec 2005
    16 Aug 2012
    Link to this post
    Use something like the following in your Bootstrapper_Initialized method--it worked for me:
    var routes = ((EnumerableQuery<System.Web.Routing.RouteBase>)args.Data).ToList<System.Web.Routing.RouteBase>();
    System.Web.Routing.Route newRoute = new System.Web.Routing.Route("Your Route Here", new YourCustomRouteHandler());
    routes.Add(newRoute);
3 posts, 0 answered