Dumisani
Dumisani

Reputation: 3048

Read Web.Config AppSettings key from HTML JavaScript. Possible?

I'm trying to access a key that is in my web.config file from javascript in a static html page. I understand that having something like <%=ConfigurationManager.AppSettings["MyAttribute"]%> in the script works well for aspx or dynamic pages.

How can I achieve the same from a static html page? Is it possible? Can it be done just by using plain javascript or will I need to modify my config file?

Any assistance will be highly appreciated. Thanks.

Upvotes: 0

Views: 1815

Answers (1)

Ravindra patankar
Ravindra patankar

Reputation: 113

Not possible to add scripting code in pain HTML unless you change ISAPI filters for html in IIS and add an httpHandler entry to the web.config to handle your page for html file. Better you create a aspx page

Upvotes: 1

Related Questions