Accessing & Assigning the Session Variable using Javascript:
(使用Javascript访问和分配会话变量:)
Assigning the ASP.NET Session Variable using Javascript:
(使用Javascript分配ASP.NET会话变量:)
<script type="text/javascript">
function SetUserName()
{
var userName = "Shekhar Shete";
'<%Session["UserName"] = "' + userName + '"; %>';
alert('<%=Session["UserName"] %>');
}
</script>
Accessing ASP.NET Session variable using Javascript:
(使用Javascript访问ASP.NET Session变量:)
<script type="text/javascript">
function GetUserName()
{
var username = '<%= Session["UserName"] %>';
alert(username );
}
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…