Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Load user control (which acts as menu) from different XML files

Posted on 2009-07-07
1
Medium Priority
?
256 Views
Last Modified: 2012-06-27
I need a way to find the xml file which is located in  the currect directory
(please see the screenshot)

now for folder NMI > zzObject.xml (contailns sitemap )
similarly and each folder has its own .xml file

now I have a user control which acts as a menu and that menu needs to be based on the xml file
So,
1. how does the user control know which page is using it
2. how does the user control acess the .xml file fom the directory where the page which has been loaded and then use it.
screenshot.jpg
0
Comment
Question by:manivineet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
vbturbo earned 1500 total points
ID: 24804918
Hello manivineet

Well there a multiple solutions to your issue and one of them is recursion

DirSearch(C:\)

Private Sub DirSearch(ByVal sDir As String)
        Try
            For Each f As String In Directory.GetFiles(sDir, txtFile.Text)
               lstFilesFound.Items.Add(f)
            Next
            For Each d As String In Directory.GetDirectories(sDir)
                DirSearch(d)
            Next
        Catch excpt As System.Exception
            Console.WriteLine(excpt.Message)
        End Try
    End Sub

another one is to select a relative path and use the above recursive function

Dim execName As String = Assembly.GetExecutingAssembly().GetModules()(0).FullyQualifiedName
Dim currentFolder As String = System.IO.Path.GetDirectoryName(execName)
Dim _path As String = System.IO.Path.Combine(currentFolder.Replace("bin\Debug", ""), "Meter\NMI\")

/vbturbo
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question