Override a view from a module in 1.4?

Topics: Writing modules
Mar 2, 2012 at 3:57 AM

Hey guys, how does one override a view within a module in 1.4?

The module in question worked with 1.3...

                new RouteDescriptor {
                Priority = 1,
                Route = new Route(
                    "Users/Account/Register",
                    new RouteValueDictionary {
                        {"area", "CNS.Donations"},
                        {"controller", "Account"},
                        {"action", "Register"} 
                    },
                    new RouteValueDictionary(),
                    new RouteValueDictionary {
                        {"area", "CNS.Donations"}
                    },
                    new MvcRouteHandler())
                }

...but now - I assume due to Routable to Autoroute change - it no longer does; so the basic question is, what is the correct way to override a core view from your module? Thanks in anticipation as always - Dyr

Mar 2, 2012 at 4:12 AM

Ignore me, noob jumping to conclusions again, all does work as expected- *sorry*.

Coordinator
Mar 2, 2012 at 4:59 PM

Also if there is a conflict with other Route, you can take precedence by increasing the priority.

Mar 7, 2012 at 4:36 PM

I am having a similar problem now that I upgraded to 1.4. @dyrgutt what was your problem and/or what was it that you realized made it work as expected. I am getting the new 404 error.  Note: my custom route worked fine after the actual upgrade to 1.4, but it seems when I upgraded Vandaly Industries to 1.4 (the earlier version required the now defunct Routing module) I lost it. I noticed that when I went to the cached module all my custom routes that were there before were gone.

Any ideas?

Mar 7, 2012 at 5:33 PM

Try increasing the Priority of your custom route to something >= 100

Mar 7, 2012 at 5:40 PM

I tried that first and nothing seems to work (tried 20, 100, 101).

For sure my route.cs file in my module is not being picked up.  The Cache module does not show all the routes I previously had under 1.3 (I am viewing Cache module on production 1.3 versus my development machine with the upgraded 1.4).

Mar 7, 2012 at 6:13 PM

What version of the Vandelay Industries module are you using? It should have been upgraded to use autoroute. 

Mar 7, 2012 at 6:24 PM

I upgraded to 1.4.1 Vandelay, but I am thinking that might not be the problem. 

Mar 7, 2012 at 6:38 PM

But I am curious, is the custom 404 error hiding an error on my site? I tried turning it off in web.config but had no luck. 

I also used the developer tools for browser (F-12) but all it says is it cannot find the file.  I will keep checking my module files with WinMerge and post back, thanks for the help.

Mar 8, 2012 at 1:15 AM

Sorry Dino, mine was a priority issue [...at least you can rule me out] - hope you sort it mate. Cheers Dyr

Coordinator
Mar 8, 2012 at 1:18 AM

If you had exceptions, they would appear in app_data\logs

May 10, 2012 at 3:53 PM

Thanks i had the same problem and it was also priority!