Guys,
Can I change this...
<asp:XmlDataSource ID="xmlDataSourceSections" runat="server" DataFile="~/Physical.xml" XPath="/PPRObject/Section" />
To take a path from my webconfig for the datafile?
AppSetting("PhysicalTemplate")
Thanks
Bob
Printable View
Guys,
Can I change this...
<asp:XmlDataSource ID="xmlDataSourceSections" runat="server" DataFile="~/Physical.xml" XPath="/PPRObject/Section" />
To take a path from my webconfig for the datafile?
AppSetting("PhysicalTemplate")
Thanks
Bob
In the codebehind, you can do this:
Code:xmlDataSourceSections.DataFile = System.Configuration.ConfigurationSettings.AppSettings("PhysicalTemplate").ToString()
(Not sure if the .tostring is required)
Not required.Quote:
Originally Posted by mendhak
This method returns string onlyQuote:
ConfigurationSettings.AppSettings
Ah, good to know. I sometimes end up using ToString() because I cannot be bothered to move my mouse over AppSettings to look at its property type and yet I can be bothered to sit here and type about it in a long winded sentence on a forum.
Priorities.