|
-
Jan 19th, 2009, 08:18 AM
#1
Thread Starter
Fanatic Member
string from webconfig
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
"I dislike 7 am. If 7 am were a person, I would punch 7 am in the biscuits." - Paul Ryan, DailyRamblings
-
Jan 19th, 2009, 08:31 AM
#2
Re: string from webconfig
In the codebehind, you can do this:
Code:
xmlDataSourceSections.DataFile = System.Configuration.ConfigurationSettings.AppSettings("PhysicalTemplate").ToString()
(Not sure if the .tostring is required)
-
Jan 19th, 2009, 08:34 AM
#3
Re: string from webconfig
 Originally Posted by mendhak
In the codebehind, you can do this:
(Not sure if the .tostring is required)
Not required.
ConfigurationSettings.AppSettings
This method returns string only
Please mark you thread resolved using the Thread Tools as shown
-
Jan 19th, 2009, 08:44 AM
#4
Re: string from webconfig
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|