473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

ASP.NET v2 Menu StaticItemTemplate


Hello to everybody,

I Wanted to know if anyone get an item in <asp:menu> to be selected,
defining display of items using StaticItemTemplate. I thought
specifying a css class for StaticSelected or StaticItemSelected should
work, but even using standart parameter of styles within the object,
this does not work.

My code :

StaticitemTemplate in page.aspx:
<StaticItemTemplate>
<table border=0 width=100%>
<tr>
<td><a href="<%# Eval("NavigateUrl")%>"><%#
Eval("Text")%></a></td>
</tr>
</table>
</StaticItemTemplate>

To select an item:
protected void TopMenu_MenuItemDataBound(object sender, MenuEventArgs
e)
{
MenuItem item = e.Item;
if (item.ValuePath == "AboutUs/Default.aspx")
{
item.Selected = true;
}
}

Hope someone can help ;-)

Thanks to all in advance.

Nov 19 '05 #1
0 1962

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
2
by: J. Jespersen | last post by:
Hi people, I'm trying to build a menu i asp.net 2.0 (RC) using the Menu control and an XmlSiteMapProvider. I want all letters of my menuitems to be capitalized, but i want the first letter in...
0
by: jtencate | last post by:
I am trying to add an OnClientClick event to links in an asp:Menu. I tried using a StaticItemTemplate to bind the MenuItem data to a LinkButton with an OnClientClick attribute. This works fine to...
0
by: AC [MVP MCMS] | last post by:
I have a navigation control (using the Menu control) that I want to only display static items (nothing dynamic). My rendering looks something like this: <ul> <li><a href="#"><div...
1
by: Kenneth Chan | last post by:
I have created a menu with the following code: <asp:Menu ID="Menu1" runat="server" BackColor="#F7F6F3" Font-Names="Verdana" Font-Size="X-Small" Orientation="Horizontal" BorderWidth="0px"...
0
by: vincent90152900 | last post by:
How to remove the arrow of the menu .net component? My code here <StaticMenuStyle CssClass="p12h20-gray" HorizontalPadding="2" VerticalPadding="2" /> <StaticMenuItemStyle...
2
by: alexandis | last post by:
I have menu bound to sitemap file. This is a piece of code <asp:menu ... > <StaticItemTemplate> <%# ((MenuItem)Container.DataItem).Selected ? : %> </StaticItemTemplate> </asp:menu> I check...
2
by: AJ | last post by:
Hi, I'm trying to customize the Menu navigation control so that the the static items have two lines. The first line will be the text (for example "About Us"), and the second line will be a short...
7
by: Mel | last post by:
What control do I use for a menu on a web page? How do I add a check box to an menu item? I have a menu called Chart and beneath it I have a menu item called Publish. I want to display a checked...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.