Is it possible to Access Web.Config file from JavaScript in an ASP.NET application ?? If yes, could someone show me how ?
Printable View
Is it possible to Access Web.Config file from JavaScript in an ASP.NET application ?? If yes, could someone show me how ?
No it isn't. IIS doesn't allow you to read web.config directly. Instead, you'll have to generate your javascript dynamically with values inserted from web.config. What do you want to accomplish?
My Web config has a key that I want to read on the fly ...Quote:
Originally Posted by mendhak
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="LegalAdmin.Admin.Jobs" value=[b]"http://localhost/Legal_TM/LegalAdmin_WS/Jobs.asmx"[b]/>
</appSettings>
</configuration>
Basically, its a Web Service address that I want to read from my java script ...
I think you'll have to go with the javascript generation approach as I mentioned earlier.