0

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.

1
  • Not possible, Maybe you can develop a webservice for that , but that will be a workaround very ugly Commented May 16, 2017 at 20:49

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.