I've looked at some post concerning the argument but I'm still missing something
because I can't read the key (in the appSettings tag of Web.config)
<add key="ROOT_URL_SERVER" value="hello" />
with this javascript in this view (MVC4)
<input type="text" value="@ViewBag.prova" />
<script type="text/javascript">
var t = '<%=ConfigurationManager.AppSettings["ROOT_URL_SERVER"].ToString()%>';
var type = '<%= ConfigurationManager.AppSettings["ROOT_URL_SERVER"] %>';
var appSettingValue = '<%=System.Configuration.ConfigurationManager.AppSettings["ROOT_URL_SERVER"]%>';
alert(t);
alert(type);
alert(appSettingValue);
</script>
even if it works when i pass the value by the viewbag with the code
{
string test = ConfigurationManager.AppSettings["ROOT_URL_SERVER"].ToString();
ViewBag.prova = test;
return View();
}
Can you help me fix this problem? Thank you!