Tricky one regarding SiteMapProvider/Menu

J

J. Jespersen

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 every menuitem to be in a larger font.

Any ideas, clues, pointers?

J. Jespersen
Denmark

ps. Example illustration what i want: http://www.netkoder.dk/menuitem.jpg
 
S

Scott Allen

You'll want to use a menu template. Like template columns in a
DataGrid you can use data binding expressions to format the apperance
and content of the node. A simple template would look like:

<StaticItemTemplate>
<%# Eval("Text") %>
</StaticItemTemplate>

You could throw in some <span> and Substring calls to get what you
need.

HTH,
 
J

J. Jespersen

Hi Scott, (and everyone else)

Thanks for your reply. Got it solved.

In my .aspx

<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
<StaticItemTemplate>
<%# formatMenuItem(Eval("Text"))%>
</StaticItemTemplate>
</asp:Menu>

In my .aspx.vb


Public Function formatMenuItem(ByVal itemText As String) As String
Return UCase("<span style=""font:14px Verdana"">" & Left(itemText, 1) & "</span><span style=""font:9px Verdana"">" & Right(itemText, (Len(itemText) - 1)) & "</span>")
End Function

Again, thanks.

J.Jespersen
Denmark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top