0

I have this in my code:

<script type="text/javascript"
  src="path?key=1234567890">
</script>

I added this in web.config:

<appSettings>
    <add key="key" value="1234567890"/>

How to implement it in the above code?

1 Answer 1

2

You use the System.Web.Configuration.WebConfigurationManager.AppSettings collection to access the configuration settings.

<script type="text/javascript"
        src="path?key=<%=WebConfigurationManager.AppSettings["key"]%>">
</script>
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.