<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Asp.Net Access Session Variable Value in JavaScript or jQuery</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function() {
var name = 'Welcome '+' <%= Session["UserName"] %>'
$('#lbltxt').text(name)
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<label id="lbltxt" />
</div>
</form>
</body>
</html>
No comments:
Post a Comment