想在html页面中获取会话变量的值 [英] Want to get value of session variable in html page

查看:142
本文介绍了想在html页面中获取会话变量的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个html页面,我想在html页面中获取会话变量的值。如何得到它。请帮助我或给出任何链接。 />
提前谢谢

Hi,
I have a html pageand i want to get the value of session variable in html page.How i'll get that.Please help me for that or give any links.
Thanks in advance

推荐答案

由于HTML页面按原样提供,服务器上没有运行代码,因此无法访问会话。您需要将其设置为ASP.NET页面,或PHP页面,或其他页面正在运行的任何其他框架。然后您可以访问会话,与其他页面相同。
As a HTML page is served as is, with no code running on the server, it cannot access the session. You'd need to make it an ASP.NET page, or a PHP page, or whatever other framework your other pages are running in. Then you can access the Session, the same as with your other pages.


您需要使用Javascript来执行此操作。 HTML无法直接理解会话变量。
You need to use Javascript to do this. HTML cannot understand session variables directly.


<div>
  <p>hello : <%= Session("mysession").ToString%> </p>

  </div>


这篇关于想在html页面中获取会话变量的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆