ASP.Net Custom Control **Resolved**
I have made a custom control with C# called SideNav.dll This control needs to open an XML file in my site and create the side navigation bar. It is all fine, but how can I tell the control where the XML file is? I have the control in a folder called bin inside the virtual folder in IIS and the XML file is in a folder called XML
Here is the structure:
C:\Inetpub\wwwroot\mySite\Default.aspx
C:\Inetpub\wwwroot\mySite\bin\SideNav.dll
C:\Inetpub\wwwroot\mySite\xml\SideNav.xml
In my aspx file I call the control like this:
<%@ Register TagPrefix="SideStuff" Namespace="myControl.Side" Assembly="SideNav" %>
<SideStuff:SideNav SelectedOption="Home" runat=server/>
I could pass "C:\Inetpub..." to a property of the control, but what if it changes when I move hosting? Can the control know where the website is on the server and just open the XML file from the correct folder? Right now the error says cannot find C:\WINNT\system32\xml\SideNav.xml