0

I have searched the site and cant find anything similar to my question. I am new to MVC so I may be asking a dumb question.

When the site is launched there are default Home and About buttons at the top. I added a new button that points to an Area, that works just fine.

When I hover over the Home and About buttons after I go to the View that is in my Area, they links on them show they are now pointing to my Area and not the root of my project.

How do I tell these buttons to still point to the root and not my Area?

Thanks for any help or words of wisdom someone will be providing.

Squeal
  • 105
  • 1
  • 3
  • 15

1 Answers1

0

This is supposed to take you to root folder.

 @Html.RenderAction("Action", "Controller", new { area = "" });

Okay I forgot to ask you what the routes look like in your global.asax.cs file? I've got a similar setup, and here are my route definitions

 routes.MapRoute(
            "Home", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", 
               action = "MaintainLists", 
              id = UrlParameter.Optional } // Parameter defaults
        );

 routes.MapRoute(
            "Default",                             // Route name
            "{controller}/{action}/{id}",          // URL with parameters
            new { controller = "Home", action = "Index", id = "" }  // defaults
        );
Rich Bianco
  • 4,141
  • 3
  • 29
  • 48
  • Hi DisplacedGuy, Sorry about that post, I got pulled away in the middle of it and I couldnt edit it. I think I am not understanding something. This is in my root/_Layout.cshtml
  • @Html.ActionLink("Home", "Index", "Home")
  • @Html.ActionLink("About", "About", "Home")
  • @Html.ActionLink("Excel Upload", "Create", "Excel", new { area = "Matrix" }, null)
  • When I go to my "Area" the Home and About buttons want to send me to somewhere in my area and not to my root. Am I missing something somewhere. I dont understrand how to make the Home and About buttons point to my root. – Squeal May 18 '11 at 23:19
  • What logic do you have in your ExcelController ? I've tried the above code in one of my apps like
  • @Html.ActionLink("Home", "Index", "Home")
  • @Html.ActionLink("About", "About", "Home")
  • @Html.ActionLink("Excel Upload", "Index", "Tenant", new { area = "Matrix" }, null)
  • , which uses my TenantController and the Home and About still work fine. – Rich Bianco May 19 '11 at 08:09
  • This is what I have in my global.asax.cs routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); – Squeal May 25 '11 at 15:20