I have a little problem, I just made a menu with some asp:hyperlink structured in list.
I just wonder if it is possible to filter some of these asp:hyperlink in relation with “roles” defined in the web.sitemap?
For example :
<ul id="topnav">
<li>Dep
<span>
<asp:HyperLink Text="testing one" NavigateUrl="/DEP/ENC/Dep_Enc.aspx" runat="server">Encode </asp:HyperLink>
<asp:HyperLink Text="testing two" NavigateUrl="/DEP/ENC/Dep_Enc_D.aspx" runat="server">Nouveau contrat</asp:HyperLink>
...
<siteMapNode >
<siteMapNode url="/DEP/Dep_Ac.aspx" title="Dép" >
<siteMapNode url="/DEP/ENC/Dep_Enc.aspx" roles="ALL" >
<siteMapNode url="/DEP/ENC/Dep_Enc_D.aspx" roles="ADMIN"/>
...
so is it possible to make disappear test two if user is not “admin”?
Thanks for help..
You can always add a
runat="server"attribute, along with anidto any classic html tag. In your case, you could add this to the<li>or<span>as needed:Then, in your code behind, use the
Visibleproperty to hide it (it won’t even be renderer to html):