Click here to Skip to main content
15,891,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Experts

I am Doing an asp.net project. and i am new in asp.net menu control..

I am populated menus using asp.net menu control and XML.. It is success.
But i get some problem with styles.. because of a div is generated at the first of code. And a onclick event is also automatically generated in main menu....

I don't want this code.. so please help me to solve this issue...
Is there any code using in asp.net menu control...

Here is the Below html code after the menu populated

HTML
<a href="#Demomenu_ZS_SM_Menu_SkipLink" style="removed:absolute;removed-10000px;removedauto;width:1px;height:1px;overflow:hidden;">
  Skip Navigation Links
</a>
<div id="Demomenu_ZS_SM_Menu">
  <ul class="level1 big-menu">
    <li>
      <a class="popout level1 with-right-arrow" href="#"  önclick="__doPostBack('ctl00$Demomenu$ZS_SM_Menu','Main styles')">
        Main styles
      </a>
      <ul class="level2 big-menu">
        <li>
          <a class="level2" href="UserControls/typography.html">
            Typography
          </a>
        </li>
        <li>
          <a class="popout level2" href="UserControls/columns.html">
            Columns
          </a>
          <ul class="level3 big-menu">
            <li>
              <a class="level3" href="UserControls/typography.html">
                sub1
              </a>
            </li>
            <li>
              <a class="level3" href="UserControls/typography.html">
                sub2
              </a>
            </li>
          </ul>
        </li>
        <li>
          <a class="level2" href="UserControls/tables.html">
            Tabless
          </a>
        </li>
        <li>
          <a class="level2" href="UserControls/colors.html">
            Colors & backgrounds
          </a>
        </li>
      </ul>
    </li>
    <li>
      <a class="popout level1 with-right-arrow" href="#"  önclick="__doPostBack('ctl00$Demomenu$ZS_SM_Menu','Main features')">
        Main features
      </a>
      <ul class="level2 big-menu">
        <li>
          <a class="level2" href="UserControls/auto-setup.html">
            Automatic setup
          </a>
        </li>
        <li>
          <a class="level2" href="UserControls/responsive.html">
            Responsiveness
          </a>
        </li>
        <li>
          <a class="level2" href="UserControls/tabs.html">
            Tabs
          </a>
        </li>
      </ul>
    </li>
    <li>
      <a class="level1 with-right-arrow" href="UserControls/ajax-demo/submenu.html">
        With ajax sub-menu
      </a>
    </li>
  </ul>
</div>
<a id="Demomenu_ZS_SM_Menu_SkipLink">
</a>



I dont want the below code...
HTML
<div id="Demomenu_ZS_SM_Menu">


Also don't need the Onclick event occurs in the main menu.
HTML
önclick="__doPostBack('ctl00$Demomenu$ZS_SM_Menu','Main styles')"


Here is my Menu control code
ASP.NET
<asp:XmlDataSource ID="XmlDataSource1" DataFile="~/zybomenu.xml" XPath="/Items/MenuItem" runat="server"></asp:XmlDataSource>
           <section class="navigable">


           <asp:Menu ID="ZS_SM_Menu" DataSourceID="XmlDataSource1" runat="server">

               <StaticMenuStyle CssClass="big-menu" />
               <StaticMenuItemStyle CssClass="with-right-arrow"/>
               <DynamicMenuStyle CssClass="big-menu" />




               <DataBindings>
                   <asp:MenuItemBinding DataMember="MenuItem" TextField="Text" NavigateUrlField="NavigationUrl"/>
               </DataBindings>
           </asp:Menu>



           </section>




Here is my XML

XML
<Items>
  <MenuItem NavigationUrl ="" Text="Main styles">
    <MenuItem NavigationUrl ="typography.html" Text="Typography"></MenuItem>
    <MenuItem NavigationUrl ="columns.html" Text="Columns">
      <MenuItem NavigationUrl ="typography.html" Text="sub1"></MenuItem>
      <MenuItem NavigationUrl ="typography.html" Text="sub2"></MenuItem>
    </MenuItem>
    <MenuItem NavigationUrl ="tables.html" Text="Tabless"></MenuItem>
    <MenuItem NavigationUrl ="colors.html" Text="Colors & backgrounds"></MenuItem>
  </MenuItem>

  <MenuItem NavigationUrl ="" Text="Main features">
    <MenuItem NavigationUrl ="auto-setup.html" Text="Automatic setup"></MenuItem>
    <MenuItem NavigationUrl ="responsive.html" Text="Responsiveness"></MenuItem>
    <MenuItem NavigationUrl ="tabs.html" Text="Tabs"></MenuItem>
  </MenuItem>
  <MenuItem NavigationUrl ="ajax-demo/submenu.html" Text="With ajax sub-menu"></MenuItem>
</Items>


Please help me to solve this...

Thanks & Regards,

Dileep.....
Posted
Updated 13-Jan-14 17:24pm
v6

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