Asp.Net Access Session variables Value in Client Side using jQuery

Asp.Net Access Session variables Value in Client Side using jQuery

In this Post We Will Explain About is Asp.Net Access Session variables Value in Client Side using jQuery With Example and Demo.Welcome on Live24u.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Asp.Net Access Session Variable Value using jQuery Example

In this post we will show you Best way to implement Set Session in Client Side using jQuery, hear for How To Use Session Value Client Side Using JavaScript In ASP.NET with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Also Read :   AngularJS Material Introduction and Hello World example




JavaScript or jQuery Code

This contains our simple custom index.js files Add Like as javascript, jQuery scripts

<script type="text/javascript">
$(function() {
var livename = 'Welcome '+' <%=Session["StudentName"] %>'
$('#livelbl_txt').text(livename)
});
</script>

Default.aspx

This contains our simple file Default.aspx.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Simple Asp.Net Access Session Variable Value using JavaScript with jQuery</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function() {
var livename = 'You Are Most Welcome '+' <%= Session["StudentName"] %>'
$('#livelbl_txt').text(livename)
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<label id="livelbl_txt" />
</div>
</form>
</body>
</html>

C# Code

This contains our simple file C# Code.

using System;
public partial class _Default : System.Web.UI.Page
{
	//Page_Load simple call
	protected void Page_Load(object sender, EventArgs e)
	{
		Session["StudentName"] = "Jaydeep Gondaliya";
	}
}

VB.NET Source Code

This contains our simple file VB.NET Source.

Also Read :   AngularJS Custom Directives example - Angular Directives

Partial Class VBCode
Inherits System.Web.UI.Page
//Page_Load simple call
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Session("StudentName") = "Jaydeep Gondaliya"
End Sub
End Class

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example





Example

I hope you have Got What is How to Get Session value in JavaScript from Asp.Net C# VB.Net And how it works.I would Like to have FeedBack From My Blog(live24u.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(live24u.com) Are Most Always Welcome.