I have a simple menu based on a standard xml sitemap, that when a link is clicked I want it to post to a controller actionresult that does not have a view/page. I don't seem to have a problem when I have a view or page or other website for the url but I do not seem to be able to just go to the desired controller actionresult... from there I will be doing some additional things and returning/redirecting etc., problem is getting to the applicable controller actionresult from criteria/attributes/elements defined in a siteMapNode.
applicable site map snippet:
<siteMapNode url="~/Home/Test" title="Test SubMenu" description="Test SubMenu" roles="*">
<siteMapNode url="~/Home/TestActionResult" title="Test ActionResult" description="Test ActionResult" roles="*" /> <!-- Does not work -->
<siteMapNode url="http://www.google.com/" title="Test ActionResult" description="Test ActionResult" roles="*" target="_blank"/> <!-- Works -->
</siteMapNode>
applicable controller action result snippet:
public ActionResult TestActionResult()
{
...
}
applicable route snippet:
routes.MapRoute(
"TestActionResult",
"TestActionResult",
new { controller = "Home", action = "TestActionResult", area = "" },
new string[] { "Namespace.Controllers" }
);
the only error i get is the mostly useless resource cannot be found error.
E.G.:
Server Error in '/' Application.
The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Home/TestActionResult
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
suggestions?
thanks in advance.