错误:预期的标识符 [英] Error: Identifier expected

查看:89
本文介绍了错误:预期的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

收到错误:预期的标识符

Got error: Identifier expected on

var myURL = '<%=ConfigurationManager.AppSettings["myURL"].ToString() %>';
....
// In my Web.Config
  <appSettings>
    <add key="myURL" value="http://..." />
  </appSettings>



我无法弄清楚bug的位置。如果你能指出,请欣赏。


I could not figure out where the bug is. Appreciate if you can point out.

推荐答案

在页面顶部添加这个,



Add this on the top of your page,

<%@ Import Namespace="System.Configuration" %>





或使用完全限定的命名空间来使用ConfigurationManager: - )



or use fully qualified namespace to use ConfigurationManager :-)


这篇关于错误:预期的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆