Is there a way to use “<%= someObject.ClientID %>” in an external javascript file?

前端 未结 8 1270
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 15:28

Is there a way to use \"<%= someObject.ClientID %>\" in an external javascript file?

If I use the code

<%= someObject.ClientID %>
         


        
8条回答
  •  伪装坚强ぢ
    2020-12-04 16:16

    I like to embed a single line of javascript on my page.

    
    

    It's poor practice to have a ton of javascript rendered on your page, but it is common to need to pass initialization values to your javascript from the server. This allows you to do it without a whole bunch of unnecessary code and without polluting the global namespace with callback functions. I usually replace Application with some project specific global wrapper.

提交回复
热议问题