How to prevent Menu Control StaticItemTemplate from wrapping html with anchor

G

Gery D. Dorazio

I am using the StaticItemTemplate in the ASP.Net Menu control. To customize
it the following html is installed:

<table runat="server" border="0" style="cursor:pointer" cellpadding="0"
cellspacing="0" onclick="this.parentNode.click();">

<tr>

<td><img src="/Images/junk.gif" width="30" height="20" /></td>

<td nowrap><asp:HyperLink ID="NavLink1" runat="server" Text='<%#
Eval("Text") %>' NavigateUrl='<%#
Eval("NavigateUrl")%>'></asp:HyperLink></td>

</tr>

</table>


This is the preliminary work for a horizontal menu which I want to show as
tabs. The intent of the two data cells in the row above is to first install
an image (junk.gif) that represents the image separating two tabs. The
example above was modified from one that was recommended by Steven Cheng for
customizing the look of a menu item and was found in a post probably in this
news group somewhere. (Thanks Steven) This example works.

However, the intermediate images between the tabs (junk.gif) also become hot
links because when the Menu controls' menu items are rendered EVERYTHING
between the StaticItemTemplate start and end tags gets enclosed between an
anchor tag. Is it possible to change this behaviour so that only the anchor
tag that I manually install shows up?

Thanks...and if you read this Steven I would really appreciate your
thoughts.

G. Dorazio
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top