I am developing excel add-ins using office.js, I want to keep the different configuration settings on the web.config files and read those settings in the javascript file.
how to do that.
Hi kishorimestry...
Generally this is not something that is Office Add-in specific. You would use the same approach as with a regular website.
For example, see ASP.Net: Read (Get) AppSettings Key Value from Web.Config file in JavaScript.
In terms of the manifest start URL, you can point it at any web-browsable page, it doesn't have to end with html.
So you can use an aspx or MVC view page. Alternatively, you can have an html/js/css page that makes an AJAX web service call to your own web API that returns you the setting.
Reference
https://stackoverflow.com/questions/37849274/how-to-read-the-web-config-file-values-in-office-addins-office-js
Hi @dharmendr
I created the web excel Add-in project in visual studio this is not ASP.net project and there is the auto-generated web. config file so how can we access the value all you provided solution i used it not worked for me
Can you guid me how can i used.
Hi dharmendr
What you provided is not safe because if I call API then secured data is also accessible.
Use JavaScript to read the value.
<appSettings> <add key="name" value="ASPSnippets"/> </appSettings> var appValue = '<%=ConfigurationManager.AppSettings["name"] %>';
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.