Accessing ConfigurationManager.AppSettings in Java script

前端 未结 1 1997
栀梦
栀梦 2021-01-29 03:01

I had this javascript code in aspx file

Page.aspx


 ----some code----
          


        
1条回答
  •  一向
    一向 (楼主)
    2021-01-29 03:33

    <%=ConfigurationManager.AppSettings["GAAccountId"]%> will work when you are using it in aspx file. It will not be evaluated when you are using it in external js file.

    You can do decalre a variable in aspx page

    
    

    Use GAAccountId variable in JS File

    0 讨论(0)
提交回复
热议问题