forum

Home / DeveloperSection / Forums / How to access a backend variable in front end using javascript

How to access a backend variable in front end using javascript

Anonymous User 2308 05-Feb-2015

I had Public declared Dictonary in code behind as :

 Public dics As New
Dictionary(Of String, String()) From { _
{"picture", New String() {".jpeg", ".jpg", ".png", ".bmp", ".gif", ".tif"}}, _
{"document", New String() {".doc", ".docx", ".txt", ".htm", ".html", ".xml", ".xaml", ".css"}}, _
{"excel", New String() {".xls", ".xlsx", ".xlt", ".xla"}}, _
{"pdf", New String() {".pdf"}}, _
{"zip", New String() {".7z", ".APK", ".BAT", ".rar", ".dll", ".jar", ".zip"}}, _
{"ppt", New String() {".ppt", ".pos", ".pps"}}}

Edit :

if i do like this

function myFunction() {
       var dic = "<%= dics %>";
       var array_keys =new Array();
       var array_values = new Array();
       for (var key in dic) {
           alert(key);
        }
     }

How can i access this Dictonary in javascript to do some operations


Updated on 05-Feb-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By