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

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -