Last post Apr 15, 2014 03:27 AM by nigampattahyd
Aug 15, 2012 11:51 AM|frost|LINK
The setup is below:
<add key="webAccount" value="12345678" />
var setWebAccountNumber = '<%=ConfigurationSettings.AppSettings["webAccount"].ToString() %>';
The error I get is shown below:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30203: Identifier expected.
Line 34: <!-- Begin Header -->
Line 36: var setWebAccountNumber = '<%=ConfigurationSettings.AppSettings["webAccount"].ToString() %>';
Aug 16, 2012 03:03 AM|amit.jain|LINK
Aug 16, 2012 10:45 PM|Allen Li - MSFT|LINK
Hi, there is no error with your codes, I tested on my computer and found they worked. I suggest commenting the error line and try to print
with behind codes to check whether the value can be got properly.
//var setWebAccountNumber = '<%=ConfigurationSettings.AppSettings["webAccount"].ToString() %>';
<form id="form1" runat="server">
protected void Page_Load(object sender, EventArgs e)
string val = ConfigurationSettings.AppSettings["webAccount"].ToString();
Aug 17, 2012 01:18 PM|frost|LINK
thanks for the responses.
why, it should work.
Apr 15, 2014 03:27 AM|nigampattahyd|LINK
any One Please help me ragarding , how can we access our Web.config Variable Inside a Dynamic .Js File ,that .Js File will be accesed By the User Directly Like
http://localhost/js/dynamictest.js (Include File).