Web Forms :: Hide Nodes In Menu Control?
Nov 12, 2010I have the following Menu control:
[Code]....
How do I hide the root node and some other nodes if I do not want it to show on the navigation menu?
I have the following Menu control:
[Code]....
How do I hide the root node and some other nodes if I do not want it to show on the navigation menu?
What I want is to show menu items Administrator or show user menu items.Show menu items using login...How I can do it with role provider, control menu and siteMap in masterpage?
View 1 RepliesI have a Menu control in MasterPage based on web.sitemap file. My website has roles enabled (AspNetWindowsTokenRoleProvider) and uses Windows authentication mode. So, user has to be in a specific Windows Group to be able to access the site. I need to allow some users to see all menu nodes and some restricted set of nodes. How do I do that?
I would like to be able to create, say following Windows groups:
domain_namemy_app_users
domain_namemy_app_superusers
domain_namemy_app_admins
and code sitemap nodes this way:
<siteMapNode url="~/MOC_Masterdata_MOC_Approvers_Plain.aspx" title="MOC Approvers" description="MOC Approvers" />
How can i have a menu control that Manage SiteMapNode from the menu to hide and Just when admin logged to see it.
[Code]....
I have written code for menu with web.sitemap and SiteMapDataSource1.I want to hide the admin panel if user has no admin rights.
How there is relation between sitemapdatasource,web.sitemap and menu.
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" />
<asp:Menu ID="Menu" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal"
OnMenuItemDataBound="OnMenuItemDataBound" onmenuitemclick="Menu_MenuItemClick" Width="100%">
<LevelMenuItemStyles>
<asp:MenuItemStyle CssClass="main_menu" />
[Code] .....
in my Database i have created 3 Categories
1) Admin
2) User
3) Standard User
How to hide any node (and it's child nodes) based upon roles without configuring the SiteMapProvider to enable security or securityTrimmingEnabled="true" .
I am designing a website. I have created a simple menu(without sitemap) in master page and a web page called home.The problem is that when I hosted this website submenu's of the menu control are hide behind the images of home webpage and if the any webpage has no image all Submenus are appears. Have any problem in my menu creation. I have copy my code in this window but due to some reason it not shown.
<dynamichoverstyle BackColor="LightBlue" Font-Bold="true" />
</asp:Menu>
I am able to bind the asp:menu with xml nodes.
My Question is how can I display my child nodes of a particular parent as 2 column flyout menu.
find the screenshot below:
[URL]
I am binding a treeview with XmlDataSource. On my login page I want to hide some node like
see my login code
if (Session["uname"] != null)
{
if ((Session["uname"]).ToString() != "")
{
if ((Session["UserType"]).ToString() == "Administrator")
{ dont hide nodes }
else { hide some nodes}
}
else
{
Response.Redirect("index.aspx");
Session["uname"] = "";
}
}
else
{
Response.Redirect("index.aspx");
Session["uname"] = "";
}
}
so how to do that, if you need my .aspx code for treeview so free to ask.
I have a few items apart of my Web.sitemap file that rely on querystring or session variables. I do not want these items to appear in my menu. Is there a way to hide it from the menu, but still be in the sitemap (for sitepath control).
View 3 RepliesI'm having a little problem with the popout icon in the ASP menu control not appearing when the sitemap node doesn't have a URL. Take the following sitemap nodes as an example:
<siteMapNode title="Top 1" url="~/Top1.aspx">
<siteMapNode title="Sub 1" url="~/Sub1.aspx" />
</siteMapNode>
<siteMapNode title="Top 2">
<siteMapNode title="Sub 2" url="~/Sub2.aspx" />
</siteMapNode>
The first top level item - Top 1 - gets a popout CSS class written to the tag that spans the label. However the second top level item - Top 2 - does not get the class. Given this class is generally used to hold the arrow indicating there's more content beneath the item there's a bit of a usability problem here. Does anyone have a workaround for this? Or alternatively, is a sitemap node without a URL attribute somehow breaking the intended usage of the control?
i'm new one to Asp.net (3.5).. plz tel me how to calculate the node, childnode, sub childnode and so on.. and tel me how to retrive value of all...
Using Recurisive i can do this but i don't how to do..
I have a code that load hierarchy( nodes) into trew view.. by selecting different date, the hierarchy result from SP will show in the treeview..
the problem is even though I select a different date.. the result( node) of previous date is still showing in addition to the new hierarchy result...
it;s like the new result node is appended to existing node.. instead of refreshing the node and showing only the new result. How can I clear out the treeview nodes before adding new nodes from different date?
I have a sitemap with about 50 nodes. I want to expand the nodes for specific links directly related to the node group to which the current page belongs. Currently, when I navigate to a page, all nodes are expanded by default. Is there a properly I can use to control this behavior?
View 1 Repliestoday i've seen that in google, the preview of one of my sites it's showing the asp.net-4.0-menu-flow-layout as a list, so the preview is very ugly.
What's the best approach to resolve this little problem and page-loading same issue?
I've to hide menu div by javascript (but when i've to show it?
How can I hide some items in my menu if you are just a user & only appears if you log in as administrator? I would like to hide the siteadmin. Below is the code:
[Code]....
I have an application where I am trying to gain as much screen area as possible. Given the following asp:menu from the Site.master can I somehow show/hide it?
[Code]....
I am using the standard template for web form with login and menu..
I would like to disable the menu when u enter the page (done this by visable = false). but after a user have logged in, i want it to be shown..
How do i get a hold on the navigation menu when a user login?
I'm using asp:Menu (with the CSS friendly control adapters) for my sites navigation. I have everything displayed the way I want it and it looks great using CSS. However, when my sub category has no links, the asp:Menu is still adding the following HTML markup to the page:
[Code]....
The problem with that is my CSS style gives that a height of 25px. So when I have no navigation links available, my design shows a 25px gap under my main navigation before the content starts.
I thought I could try to solve this on my own but I haven't figured it out yet. There doesn't appear to be an option in asp:Menu to correct that behavior, so I started looking into adding a bit of code to my code behind file and then using Jquery to add a "visibility:hidden" to that <DIV> tag.In my code behind file (for the Master Page that displays the asp:Menu), this is what I'm trying to use:
[Code]....
I thought that would check the subMenu, and if there is no current node available, it would add the <SPAN> markup shown above.Then, on the MasterPage.master, I thought I could use the following Jquery:
[Code]....
I think the Jquery will work once I have the code in the code behind file working correctly. Not sure what I'm doing wrong though, or if I'm going about this the wrong way.
I have menu item on which come from website map. I have trimmed the main item of menu based on user roles.
Like i have one menu in which i have 5 reports i want to show 2 reports to agents and 5 reports to admin. how to apply roles on sub menu item.
In my asp.net application I'm using TreeView control, and at some point I noticed that TreeView.Nodes property doesn't return all the nodes, so I'm curious how can I get ALL Nodes of TreeView control to iterate through them in foreach loop, any tricks, or I miss something?
View 6 RepliesI am using wicked code sqlsitemapprovider and it's VB version. Most of the things are going OK! But when I wanted to hide some of the nodes from appearing on menu while staying shown on sitemappath I cannot figure it out. I tried to change the sqlsitemapprovider code but was unsuccessfull.
[Code]....
and I get this error:
Özel Durum Ayrıntıları: System.IndexOutOfRangeException:
visibleKaynak Hatası:
[Code]....
Kaynak Dosya: D:WebsiteskaihlApp_CodeSqlSiteMapProvider.vb Satır:
156
How can I add this functionality into this system.
I am Trying to hide Navigation Menu Item on my master page based on a selected item from a Drop Down List on another page. I think i need to use a session to get the pages to communicate, which i can do just fine. Im having a problem putting together the code to actually Hide the link based on the specific answer of the DDL.
View 11 RepliesI am using the default menu bar in visual web developer 2010.I have a Staff Portal item, this has child nodes such as sales, marketing that i would like to keep hidden until the user logs in.I'm using vb.net if that comes into it
View 5 RepliesIs there a way to add/delete/update the default classes (for instance AspNet-Menu-WithChildren,AspNet-Menu-NonLink ) of the html generated by the asp.net menu or treeview control? I am using CSSAdapters so the menu control renders in a list format instead of table format.
View 1 Replies