Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Need help please....

Currently i trying to adopt a free CSS template into a masterpage in ASP.Net. I got stuck at the menu area. Let say the scenario is like this.

1. Current menu from HTML that will be replace by ASP:Menu is :
<ul>
     <li><a href="index.html"><span><span>Home</span></span></a></li>
     <li><a href="support.html"><span><span>Home</span></span><a></a></a></li>
     ...
</ul>


2. The CSS was targeted to the span so it put left pic and right pic for menu pic with these selectors in CSS:
ul li a { background:url(images/menu_left.gif) no-repeat left top; }
ul li a span { background: url(/images/menu_right.gif) no-repeat right top;}


3. Now i try to move that menu from HTML to masterpage.master and replacing it with
<asp:Menu>
using Web.sitemap. But i got the problem with the css. therefore i want to try to use the
<staticitemtemplate></staticitemtemplate>
. But i can't find the way. I try to put it in masterpage.master like this:
<staticitemtemplate>
  <ul><li><a href=""><span><span></span></span></a></li></ul>
</staticitemtemplate>

when i put it in browser and go to view the page source it become them template inside the pregenerated code of asp:menu.
<ul class="level1">
  <li><a title="Home" class="level1 selected" href="default.aspx">
    <ul><li><a href=""><span><span></span></span></a></li></ul>
  </a></li>
</ul>


That is the story. can somebody help me in this matter ?
How to arrange a proper item template for menu ?


Thank you.
Posted

1 solution

ok people, i have googled from morning and finally got one that i tested become the solution. the website is : http://mail.java2s.com/Code/ASP/Components/MenutemplateC.htm[^].

I put the code inside my StaticItemTemplate like this :
<staticitemtemplate>
    <span><span><![CDATA[<%# Eval("Text") %>]]> </span></span>
</staticitemtemplate>


by that i got the html structur i need for CSS to take effect. but i come to another question. this question come to me quite long enough but don't know how to ask.

How do i know what property Eval over ? is it the same with Bind ?

thank you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900