Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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
(no name)140.5K
v2

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

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 120
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,611
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 28 Mar 2011
Copyright © CodeProject, 1999-2014
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