Accessing Asp.Net Session variables in JS

前端 未结 4 2074
深忆病人
深忆病人 2021-01-05 12:44

I\'m not able to access the variable in my .js file

the code i have at the top of the page is:



        
4条回答
  •  醉酒成梦
    2021-01-05 13:13

    Just use:

    var privilage = '<%=Session["privilage"]%>';
    

    or try:

    alert(privilage);
    

    It will display your Session value

提交回复
热议问题