HTTP Post, Value cannot be null. actionDescriptor

Jun 23, 2010 at 12:14 PM

Hi.

I've have a weird situation here with the new MVC SMP 2.0.

I get this error in Html.Menu() when performing a HTTP Post against an action.

When debugging, I see that the following returns null when one of the nodes traversed points to an action which is decorated with the [HttpGet] attribute. Note that it only happens during HTTP Post.

AuthorizeAttributeAclModule.cs

ActionDescriptor actionDescriptor = controllerDescriptor.FindAction(controllerContext, mvcNode.Action);

Using MVC2

[ArgumentNullException: Value cannot be null.
Parameter name: actionDescriptor]
System.Web.Mvc.AuthorizationContext..ctor(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +401051
MvcSiteMapProvider.AuthorizeAttributeAclModule.IsAccessibleToUser(IControllerTypeResolver controllerTypeResolver, DefaultSiteMapProvider provider, HttpContext context, SiteMapNode node) +588
MvcSiteMapProvider.DefaultAclModule.IsAccessibleToUser(IControllerTypeResolver controllerTypeResolver, DefaultSiteMapProvider provider, HttpContext context, SiteMapNode node) +125
MvcSiteMapProvider.DefaultSiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) +24
System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context) +17
System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) +356
System.Web.SiteMapNode.get_ChildNodes() +27
System.Web.SiteMapNode.get_HasChildNodes() +7
MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, String providerName, Boolean showStartingNode, Int32 startingNodeLevel, Boolean startFromCurrentNode, String selectedMenuItemCssClass, String openedMenuItemCssClass, Int32 maxLevels, Object menuHtmlAttributes, Int32 pinnedNodeLevel) +326
MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, String providerName, Boolean showStartingNode, Int32 startingNodeLevel, Boolean startFromCurrentNode, String selectedMenuItemCssClass, Int32 maxLevels, Object menuHtmlAttributes, Int32 pinnedNodeLevel) +36
MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, String providerName, Boolean showStartingNode, Boolean startFromCurrentNode, String selectedMenuItemCssClass, Int32 maxLevels, Object menuHtmlAttributes) +33
MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, Boolean showStartingNode, Boolean startFromCurrentNode, String selectedMenuItemCssClass, Object menuHtmlAttributes) +51
MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, String selectedMenuItemCssClass, Object menuHtmlAttributes) +17

Coordinator
Jun 23, 2010 at 1:57 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.