javascript - Accessing JS variable in Razor and Aspx -
javascript - Accessing JS variable in Razor and Aspx -
this code:
<% if (somecondition) { %> var activetab = $("#mytabs").tabs("option", "active"); var language = <% mylanguages[activetab] %> ; <% } %>
mylanguages of type dictionary.
i want access mylanguages[activetab]. how do this?
try this, variable gets value of variable, @ render time :
<% if (somecondition) { %> var activetab = $("#kiosktabs").tabs("option", "active"); var language = '@html.raw(mylanguages[activekiosktab])'; <% } %>
javascript asp.net-mvc razor
Comments
Post a Comment