Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Reading a physical xml file from a sharepoint webpart.

Reading a physical xml file from a sharepoint webpart.

Scheduled Pinned Locked Moved SharePoint
questionsharepointxml
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Steve Holdorf
    wrote on last edited by
    #1

    I have a custom menu control that's content is read from the physical path of an XML file. What I need to do is first write the xml to this physical location path then load the menu's XmlPath(Menu1.XmlPath = @"C:\temp\MenuData.xml"). How can I do this in a WebPart? Thanks, Steve Holdorf

    R N 2 Replies Last reply
    0
    • S Steve Holdorf

      I have a custom menu control that's content is read from the physical path of an XML file. What I need to do is first write the xml to this physical location path then load the menu's XmlPath(Menu1.XmlPath = @"C:\temp\MenuData.xml"). How can I do this in a WebPart? Thanks, Steve Holdorf

      R Offline
      R Offline
      Rajesh Sitaraman
      wrote on last edited by
      #2

      add this xml into the layouts mapped folder and then in your web part read the xml. It will solve the permission issues on reading the physical file from some other folder and easy to package and distribute across your multiple wfe servers.

      --- Rajesh MVP

      1 Reply Last reply
      0
      • S Steve Holdorf

        I have a custom menu control that's content is read from the physical path of an XML file. What I need to do is first write the xml to this physical location path then load the menu's XmlPath(Menu1.XmlPath = @"C:\temp\MenuData.xml"). How can I do this in a WebPart? Thanks, Steve Holdorf

        N Offline
        N Offline
        Net Jim
        wrote on last edited by
        #3

        We really need to get you into thinking in terms of document libraries instead of touching the 14 hive. This is what you will also do with your images, Silverlight web parts, and much more. Document libraries are more than just ftp over http. They are file storage for applications as well. Here is a code sample blog for reading xml into a web part. http://www.jdxyw.com/?p=631[^]

        S 1 Reply Last reply
        0
        • N Net Jim

          We really need to get you into thinking in terms of document libraries instead of touching the 14 hive. This is what you will also do with your images, Silverlight web parts, and much more. Document libraries are more than just ftp over http. They are file storage for applications as well. Here is a code sample blog for reading xml into a web part. http://www.jdxyw.com/?p=631[^]

          S Offline
          S Offline
          Steve Holdorf
          wrote on last edited by
          #4

          Great example for reading a library document but what I need to do is open my template menu.xml file, then modify the xml with the new menu data, then write it back to the source (library document), then finally set it as the source for my custom menu control contextMenu.xmlPath = "libraryFile.xml". Is this possible or am I missing something. I am new to SP and still a little lost. Thanks, Steve Holdorf

          N 1 Reply Last reply
          0
          • S Steve Holdorf

            Great example for reading a library document but what I need to do is open my template menu.xml file, then modify the xml with the new menu data, then write it back to the source (library document), then finally set it as the source for my custom menu control contextMenu.xmlPath = "libraryFile.xml". Is this possible or am I missing something. I am new to SP and still a little lost. Thanks, Steve Holdorf

            N Offline
            N Offline
            Net Jim
            wrote on last edited by
            #5

            I am up against a couple of deadlines for grad school and work at the same time. Here is what I can tell you fast. What you want is possible. I would setup the coding research tasks as follows: code doc lib url as property of web part (this gives you a flexibility for where doc lib can be--not hard coded). Rt click on doc in lib get url directly to item in library. http://zimmergren.net/technical/how-to-custom-web-part-properties-toolpart[^] Next read and write to xml file in doc library. I gave you the read part. The write part is here: Updating list item in document library[^]Of course we would point to Codeproject where possible.:cool:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups