.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

menu and sitemap have errors.

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

Hi there I am a student in an ASP.NET class 2.0.

Anyways, I am getting squigly lines in my code and asp.net is telling me that the sitemap and my menu are not supported.
I am trying to make my code as clean as possible, the code works but is just not clean enough. Please tell me why there are squigly lines and what I can
Do to make the page more asp.net friendly.

Thanks Much!

JonnyBelow is my code I am useing in a master.master page.  Thanks in advance.


<form id="form1"

View Complete Post

More Related Resource Links

Menu - Role security not working on second level of sitemap


I have role assignments on both the first and second level of my menus within my sitemap file.  The first level works fine, and I only see items assigned to my role.

But roles assignments seem to have no effect on the second level.  It seems like if you have access to the first level, you have access to everything on the second level.

Is this correct?

From my sitemap (either a SalesRep or an Administrator can see everything underneath):

    <siteMapNode title="Administration" roles="SalesRep,Administrator" description="Admin" >

      <siteMapNode title="CompanyMaintenance" roles="SalesRep" url="~/Admin/CompanyManagement.aspx" />

      <siteMapNode title="Initialize Roles" roles="Administrator" url="~/Admin/Roles.aspx"/>


From my config:

    <roleManager enabled="true" defaultProvider="SqlRoleProvider">

Adjusting fontcolor on a sitemap menu


I've been working for hours on something that should be simple but baffles me.  Perhaps, someone could give me a suggestion.

I'm trying to change the font color of a sitemap to white.  The color is white in the developer screen but black in the browser when I run it.  In fact, it should change to white when I hover over it but it does not.

Here is my code perhaps someone could see what I'm doing wrong.


<td class="style3" bgcolor="#E3D8B6" width="200px" style="float: right; color: #FFFFFF;">

     <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" StaticDisplayLevels="2" ForeColor="White" ItemWrap="True" BorderStyle="Solid" StaticSubMenuIndent="0px" BorderWidth="1px">

          <StaticSelectedStyle Font-Italic="True" BackColor="#1C5E55" />

          <DynamicSelectedStyle BackColor="#343055" ForeColor="White" />

          <StaticHoverStyle BackColor="#332F54" ForeColor="White" />


Strange web.sitemap asp:menu behavior


I have a menu that is populated from a web.sitemap.  It works most of the time but on some every once in a while the links will have "/(x(1))/" inserted into them.   The links still work but people are prompted to login for each page they go to.

If I compare my local copy of the web.sitemap with the live one they are identical.  Replacing the live sitemap with my local copy fixes the problem.  I can even copy the live one down to my local machine and then back up and it will fix the problem.  So something is being reset, I'm just not sure what it is.  Any thoughts on how to fix this?

This is the only search result that seems relevant but I'm still not sure how to go about fixing it.


Sitemap and menu


Hi everyone!

I have question about using sitemap and i would appreciate everyone reply me. I am creating navigation menu using sitemap. i need to create the menu inline as 1)Home 2)Services  3)Contacts 4)FeedBack. but all elements are included into parent node so i have menu with one parent element displayed

Q1. How can i hide the parent elemet of  <sitemapnode> as it contains of all menu element that cause menu to be displayed one parent element with child elements.  Is it ok to use showstartnode="false" for SiteMapDataSource? if it is what should i specify for url elements of parent sitemapnode (it should be empty one as i guess)?

Q2. What do you think about using sitemap for navigation menu at all? Can it affect to site perfomance ? Maybe it is better to use css menu?

Q3. And what about dynamic menu based on <aspx:menu> and sitemap if user's browser has javascript action disabled? i guess dynamic menu will be failed in this case, won't be?

Css menu control with Sitemap, rollover and dynamic images


Hi all

I have been building a site (http://www.leisurepursuits.co.uk) but i am having some trouble.

I built it using a bunch of links with a css rollover style.

However, what i would like to do is a)have sub menu items and b) have it so that the button which relates to the page the user is on is always highlighted.

Now to me, the obvious choice would be to build a sitemap (which i have done) use the menu control (which i have done) apply images to each individual node (i dont know how to do this) create a rollover (i dont know how to do this) and then programatically make it so the button stays highlighted if they are on the relevant page (i dont know how to do this)

So is anyone able to point me in the irght direction for doing the last three at all?

I have been googling for ages and just cannot find a half decent tutorial on the menu control which covers the points i make above.

I would really apreciate your help

Thanks very much

ASP.NET Menu with jQuery Superfish

Choosing the right type of menu for a website is not easy at all. The ASP.NET Menu Control is definitely NOT a good starting point due to the horrendous markup it renders, nor is it good for SEO because of the Markup/Content ratio, neither can it be easily styled.

Problem making Role based Menu in MVC application



 I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.

 I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net

 I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute

 but this coding does not count  those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx 

 In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and  some links are available rolewise.Now what is the solution for that?



DropDownExtender - menu disapears


Hello all, first ever post here :)

Hope you guys can help me out, this drives me crazy...

So I got 2 updatepanels on my page. In one there is a Timer which updates for example a label. In the other one there is a dropdownextender. Everytime the timer ticks while the dropdown menu is displayed the menu disapears. I attached the sample code below....any insights on this? And yes, the dropdown and the label need to be in two seperate updatepanels....

Many thanks



<form id="form1" runat="server">

<asp:ToolkitScriptManager ID="ScriptManager1" runat="server" />

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="4000" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

<asp:UpdatePanel ID="UpdatePanel2" runat="server">


How can I be sure that my entire project is up-to-date and free of errors in VS2010?


Seems like a stupid question, but I will go to Build > Build Solution many many times and the build will succeed many many times, then I will put in a minor syntax error and the build will fail, BUT the build will not fail because of the minor syntax error; it will fail because of an unresolved type that I put in about twenty compiles ago. And then I will fix the minor syntax eror, and the compiler will still complain about the unresolved type. Here is my code:

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
  <form runat="server">
  Hello World!!  

Pretty simple, really. I go to Buld > Build WebApplication1 and it runs OK. Now, if I put in a minor syntax error, such as substitute "forrrrrrrm" for "form" and then try to Build Solution, it complains not about the misspelled word, but about the FreeTextBox. And then if I correct the misspelled wird, it still complains about the FreeTextBox. Which leads me to believe that Building the Solution does not check absolutely 100% everything that needs to be checked. Is there a more thorough way of compiling a program that I need to use?

Can't get an Icon to show for Desktop shortcut and Program Menu



I've created a SetupWizard, but can't get it to show the Icon for the shortcut on desktop and program menu. The installation goes fine without any errors, the only problem is the icon.

I've made a shortcut of my exe file in the Application Folder and dragged the shortcut to the Desktop folder, then on the shortcut properties, I assigned it an icon picture located in Application Folder.

Any suggestions will be very much appreciated.


Custom Control Design-Time SiteMap Provider Error


Greetings - I was referred here by MSDN forums hope this is the right place -  

I have a custom control (:WebControl) that renders web.sitemap in a specific way. While it runs error free and produces the expected result, at Design-Time it complains

Error Creating Control - MyControl  The provider 'AspNetXmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection.

I have discovered that the error is cause by this line of code:

string div = string.Format("<div class='{0}' id='{1}'>{2}</div>", this.CssClass, this.ID.ToString(), EnumerateNodesRecursive(SiteMap.RootNode, level));

or more specifically, by the reference to SiteMap.RootNode - I am not clear what is missing thoough because I have configured the SiteMapProvider in web.config as this:

        <add name="AspNetXmlSiteMapProvider" 
             type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

Word Automation - Multiple DCOM Errors/Behavior

Before I get started, I already know that Microsoft does not support and highly discourages server-based MS Office automation.  I've read a multitude of posts and smarmy "*wink*, here's a link" replies, so I'm looking for actual help here, not condescending reprimands.

That notwithstanding, here is my problem.  I have developed a simple method that will open a local Word document, modify some header information, and then save the document as a new file.  As expected, it works great as a console/windows app, but as soon as I went to ASP.NET, DCOM jacked my world up when accessing the app remotely from a different domain account (that has access to the ASP.NET app.  For reference, my method is shown below:


1    public static string ModifyAndSaveBuildDocument(string localFilePath, BuildDocumentType docType, string buildNumber, DateTime buildDate, string projectName)
2            {
3                try
4                {
5                    ProjectConfiguration config = (ProjectConfiguration)ConfigurationManager.GetSection("ProjectConfiguration");

May i use the collapse and expand feature (like tree menu) in Report ?


HI all,

May i use the collapse and expand feature (like tree menu) at Report iam using the Report viewer  Control for displaying the Report on my Asp.net Page .


I have number records and each record have detail as i clicked or expand the record then details will be shown is it possible with report viewer control 
If any one have experince before please share the ideas.


Best Regards

Changing classic asp.net Menu to CssAdapterMenu


Hello Friends,

                     I have been using asp.net menu control that is programmatically binded at runtime and has n child node levels. Now i want to use CssAdapterMenu instead because the menu control contains more than 1000 menuItems(in the near future it can also be more 2000 menuItems) and has very slow response in IE 6 or IE 7.

                    Now my question is how should i change the classic asp.net menu to CssAdapterMenu. What should be the steps? Any samples example of n child node levels would be helpful


Asp.net menu cssadapter


Hi All,

I am using asp.net menu using cssadapter. How Can I change this the menu show menu using mouse click




Modify Menu adapter to show selected


Hey, I need some help modifying the menu adapter code to give child <ul> elements a class value indicating that the parent is selected. It should render like this:


< ul class="AspNet-Menu">
	< li class="AspNet-Menu-WithChildren  AspNet-Menu-ChildSelected">
		< a href="/rockit/admin/Default.aspx" class="AspNet-Menu-Link  AspNet-Menu-ChildSelected">
		< span>Mypage< /span>< /a>
			< ul class="AspNet-Sub AspNet-Sub-Selected">
				< li class="AspNet-Menu-Leaf  AspNet-Menu-Selected">
					< a href="/rockit/admin/Default2.aspx" class="AspNet-Menu-Link  AspNet-Menu-Selected">
					< span>Test< /span>< /a>
				< /li>
				< li class="AspNet-Menu-Leaf">
					< a href="/rockit/Default3.aspx" class="AspN

How to keep the hover for Parent menu and set the selected menu item css for child menu item?



I'm using cssfriendly control adapter for menu. My asp.net menu control's datasource is a sitemap file I'm using which contains all the urls.

I have the following questions:

  1. Is there a way to keep the parent menu item hovered while hovering over the respective child menu items?
  2. Is there a way to keep the child menu item selected? I am able to set the css for the parent menu, however I was wondering if the same is possible with the child items.

Please help! Smile


Moneka Smile

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend