Get Current Session Value in JavaScript?

后端 未结 11 1563
深忆病人
深忆病人 2021-02-05 01:10

I have a scenario where I open my web application in a browser but in two separate tabs.

In one tab I signed out from the application and as a result the all session val

11条回答
  •  孤街浪徒
    2021-02-05 01:36

    would be a lot easier to use Razor code in your page.

    in my example, i needed to set a hidden field with a session variable.

    $('#clearFormButton').click(function(){
        ResetForm();
        $('#hiddenJobId').val(@Session["jobid"]);
    });
    

    that easy. remember, you need to preface the Session with a @ sign for razor syntax.

提交回复
热议问题