如何在html页面中获取会话值? [英] How to get session value in html page ?

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

问题描述

Hi
如何在html页面中获取会话值?我需要使用javascript或jquery在html页面中获取会话值。



在aspx页面中,我在以下代码中添加会话值



Hi How to get session value in html page ? i need to get session value in html page using javascript or jquery.

In aspx page i add value in session in following code

Session("fCSearch") = contentSearchStr.Trim





以上会话值如何进入html页面。





注意:需要在html页面获取价值,而不是在aspx页面中获得价值



问候

Aravind



The above session value how to get in html page.


Note:Need to get value in html page ,not in aspx page

Regards
Aravind

推荐答案

您无法在 HTML 页面中访问服务器会话值 HTML 服务器不处理页面。最好使用 aspx 页面。



否则,如果你从 aspx导航页面到 HTML 页面,然后尝试通过加密查询字符串或存储在 cookie 中并像这样获取它。但这不是一个好方法。
You cannot access Server Session Value in a HTML Page as HTML Pages are not processed by Server. Better to use aspx Pages.

Otherwise, if you are navigating from a aspx page to a HTML Page, then try to send the Session Value in some way by encrypting in query string or storing in a cookie and fetching it like that. But this is not a good approach.


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

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