tags:

views:

643

answers:

2

my web.sitemap is

<?xml version="1.0" encoding="utf-8" ?>
<siteMap  xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"  >
  <siteMapNode url="~/Index.aspx?id=Home" title="Dashboard" description="">
    <!-- Catalog Management-->
    <siteMapNode url="~/Index.aspx?id=CategoryHome&amp;category=CatalogManagement" title="Catalog Management" description="">
      <siteMapNode url="~/Index.aspx?id=ProductManager" title="Products" description="">
        <siteMapNode url="~/Index.aspx?id=EditProduct" title="Add Product" description="" />
      </siteMapNode>
      <siteMapNode url="~/Index.aspx?id=Attributes" title="Variations" description="">
        <siteMapNode url="~/Index.aspx?id=AddEditVariation" title="Add/Edit Variations" description="" />
      </siteMapNode>
      <siteMapNode url="~/Index.aspx?id=GiftCertificateManager" title="Generate Gift Cards" description="" />
      <siteMapNode url="~/Index.aspx?id=DepartmentManager" title="Departments" description="">
        <siteMapNode url="~/Index.aspx?id=AddEditDepartment" title="Add/Edit Department" description=""/>
      </siteMapNode>
      <siteMapNode url="~/Index.aspx?id=ManufacturerManager" title="Manufacturers" description="" >
        <siteMapNode url="~/Index.aspx?id=AddEditManufacturer" title="Add Manufacturer" description="" />
      </siteMapNode>
      <siteMapNode url="~/Index.aspx?id=WarehouseManager" title="Warehouses" description="">
        <siteMapNode url="~/Index.aspx?id=EditWarehouse" title="Add Warehouse" description="" />
      </siteMapNode>
    </siteMapNode>

one more XML is there for Telerik menu

<?xml version="1.0" encoding="utf-8" ?>
<PanelItems>
  <PanelItem Text="Dashboard" NavigateUrl="../Index.aspx?id=Home"></PanelItem>
  <PanelItem Text="Catalog Management" NavigateUrl="../Index.aspx?id=CategoryHome&amp;category=CatalogManagement">                  <!--  -->
    <PanelItem Text="Products" NavigateUrl="../Index.aspx?id=ProductManager"/>                          <!-- Product Manager -->
    <PanelItem Text="Variations" NavigateUrl="../Index.aspx?id=Attributes"/>
    <PanelItem Text="Generate Gift Cards" NavigateUrl="../Index.aspx?id=GiftCertificateManager"/>       <!-- Gift Certificate Manager -->
    <PanelItem Text="Departments" NavigateUrl="../Index.aspx?id=DepartmentManager"/>                    <!-- Department Manager -->
    <PanelItem Text="Manufacturers" NavigateUrl="../Index.aspx?id=ManufacturerManager"/>                <!-- Manufacturer Manager -->
    <PanelItem Text="Warehouses" NavigateUrl="../Index.aspx?id=WarehouseManager"/>                      <!-- Warehouse Manager -->
  </PanelItem>
  <PanelItem Text="Customer Management" NavigateUrl="../Index.aspx?id=CategoryHome&amp;category=CustomerManagement">                <!--  -->
    <PanelItem Text="Customers" NavigateUrl="../Index.aspx?id=CustomerManager" />
    <PanelItem Text="Export Subscribers" NavigateUrl="../Index.aspx?id=ExportSubscriptions"/>           <!-- Export Subscribers -->
  </PanelItem>
  <PanelItem Text="Order Management" NavigateUrl="../Index.aspx?id=CategoryHome&amp;category=OrderManagement">                      <!--  -->
    <PanelItem Text="Orders" NavigateUrl="../Index.aspx?id=FindOrders" />                               <!-- Find Orders -->
    <PanelItem Text="Shopping Carts" NavigateUrl="../Index.aspx?id=CartView"/>                          <!-- View Cart -->
    <PanelItem Text="Wish Lists" NavigateUrl="../Index.aspx?id=ViewWishList"/>                          <!-- View Wish List -->
  </PanelItem>

and one more thig is I am using 5 resource file for 5 menus

how to convert XML in to resources

A: 

XSLT

annakata
+1  A: 

I don't know if I fully understand the question. If you want to take these XML and instead of deploying them along with your apllication to have them as a resource in an assembly then you need to do the following:

  • select the file in the Solution Explorer
  • open Properties window (F4)
  • set Embedded Resource in Build Action

Now your XML is embedded as a resource in your assembly. Now the question is how to access it. For this use the following code:

Assembly assembly = Assembly.GetExecutingAssembly();
Stream stream = assembly.GetManifestResourceStream("<default namespace.>MyFile.xml");
StreamReader streamReader = new StreamReader(stream);
// now process the stream the way you want -- for example streamReader.ReadToEnd() to get it as a text

There is a good CodeProject article called Embedded resources.

David Pokluda