/ / Cómo ocultar el nodo con el proveedor de ASP.NET MVC SiteMap - asp.net-mvc-3, mvcsitemap

Cómo ocultar el nodo con el proveedor ASP.NET MVC SiteMap - asp.net-mvc-3, mvcsitemap

Tengo un nodo que quiero ocultar cuando el usuario está autenticado.

¿Cómo puedo hacer eso con el proveedor ASP.NET MVC SiteMap?

Intenté eso:

http://mvcsitemap.codeplex.com/discussions/246986

pero luego estoy recibiendo un error:

Value cannot be null.
Parameter name: type
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: type

Source Error:

Line 114:               @Html.MvcSiteMap("MvcSiteMapProvider").Menu()

Respuestas

3 para la respuesta № 1

Puede ocultar su nodo para usuarios autenticados especificando roles = "?" en su nodo:

<mvcSiteMapNode controller="HomeController" action="Index" title="Home" roles="?"/>