Hi guys,
I'm trying to pass a variable stored in the Session object of my ASP.NET page with jQuery, representing the progress of a process running on the server as a percentage.
i.e:
Session['progress'] = 37;
I've looked through some of the answers here; my code uses the same method as a question aswered correctly here:
<head>
...
<script type="text/javascript">
function updateProgress() {
var progress = '<%Session["progress"].ToString();%>';
}
</script>
...
</head>
The ASP.NET compiler is returning a NullPointerException
. I'm unsure if this is because the Session object hasn't been instantiated yet (as this is occurring at compile time); or perhaps the Session object isn't receiving the variable properly (if this is the case, how can I go about checking this out?)
Any ideas?
I need to find some way off passing this value from the server to the client so a jQuery progress bar may be updated for the user.
Thanks!