Click here to Skip to main content
12,077,195 members (48,182 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi,

i am using jquery menu control from the following site
ASP.NET Dynamic XML Web Menu Control based on JavaScript[^]
but i am unable to view the data my code is
SqlConnection cn = new SqlConnection(connectionstring);
                string str = "SELECT FormID as menuid,FormName as name,ParentID as root,URL as url FROM FormsMaster";
                // string str = "SELECT ParentID as root,FormName as name,FormID as menuid,URL as url FROM FormsMaster";
                SqlDataAdapter da = new SqlDataAdapter(str, cn);
                DataSet ds = new DataSet();
                da.Fill(ds);
                ds.DataSetName = "menu";
                ds.Tables[0].TableName = "menuitem";
 
                StreamWriter xmlDoc = new StreamWriter(Server.MapPath("~//menudata.xml"), false);
 
                // Apply the WriteXml method to write an XML document
                ds.WriteXml(xmlDoc);
                xmlDoc.Close();
                DataSet dsMenu = new DataSet();
                dsMenu.ReadXml(Server.MapPath("~//menudata.xml"));
                // WebMenu1.MenuXMLPath = Server.MapPath("~//menudata.xml");
                WebMenu1.DataSource = dsMenu;

and xml file is also generating with the data but not displaying in the menu control .my xml data is

<menu>
  <menuitem>
    <menuid>1</menuid>
    <name>a1</name>
    <root>""</root>
    <url />
  </menuitem>
  <menuitem>
    <menuid>2</menuid>
    <name>a2</name>
    <root>""</root>
    <url />
  </menuitem>
  <menuitem>
    <menuid>3</menuid>
    <name>a21</name>
    <root>1</root>
    <url>http://www.google.com</url>
  </menuitem>
  <menuitem>
    <menuid>4</menuid>
    <name>a211</name>
    <root>1</root>
    <url>http://www.google.com</url>
  </menuitem>
</menu>

but for testing when i keep the xml data from the site given above it is getting
<menu>
    'Level 0 nodes
    <menuitem root="" name="Search Sites" menuid="1" />
    <menuitem root="" name="Webmail Sites" menuid="2" />
    <menuitem root="" name="DotNet Sites" menuid="3" />
    
    'Level 1 Items
    <menuitem root="1" name="Google" url="http://www.google.com">
                                                        menuid="11"/>
    <menuitem root="1" name="Altavista" url="http://www.Altavista.com">
                                                        menuid="12"/>
    
    'Level 1 Items
    <menuitem root="2" name="Hot-mail" url="" menuid="21" />
        'Level 2 Items
        <menuitem root="21" name="Hotmail" url="http://www.hotmail.com">
                                                          menuid="211"/>
        <menuitem root="21" name="MSN" url="http://www.MSN.com">
                                                          menuid="212"/>
        
    <menuitem root="2" name="Yahoo" url="http://www.yahoo.com">
                                                           menuid="22"/>
    <menuitem root="2" name="Rediff" url="http://www.rediff.com">
                                                           menuid="23"/>
    
    'Level 1 Items
    <menuitem root="3" name="Microsoft" url="http://www.Microsoft.com">
                                                           menuid="31"/>
    <menuitem root="3" name="GotDotNet" url="http://www.GotDotNet.com">
                                                           menuid="32"/>
    <menuitem root="3" name="CodeProject" url="http://www.CodeProject.com">
                                                           menuid="33"/>
    <menuitem root="3" name="ASpdotnet" url="http://www.ASpdotnet.com">
                                                           menuid="34"/>
    
</menuitem></menuitem></menuitem></menuitem></menuitem></menuitem></menuitem></menuitem></menuitem></menuitem></menu>


please help me as if it is format problem
Posted 28-Mar-11 2:27am
Edited 28-Mar-11 2:28am
Prerak Patel141.5K
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160212.1 | Last Updated 28 Mar 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100