Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get asp.net Session value in jquery method?

I want to access a Session value in jquery method in the ASP.NET MVC view page. See the below code,

$('input[type=text],select,input[type=checkbox],input[type=radio]').attr('disabled', '<%= Session["CoBrowse"].ToString() %>');

How can I get the Session value in jquery.

like image 395
Ravi Avatar asked May 13 '09 07:05

Ravi


1 Answers

<input id="sessionInput" type="hidden" value='<%= Session["name"] %>' />

var getSessionValue = $('#sessionInput').val();
like image 111
fyalavuz Avatar answered Oct 22 '22 03:10

fyalavuz