如何在服务器端获取HTML5本地存储值 [英] How can i get the HTML5 Local storage values in server side

查看:675
本文介绍了如何在服务器端获取HTML5本地存储值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是.Net开发人员,我知道HTM5 localstorage是客户端存储技术。我想在服务器端获取本地存储数据。

I am a .Net developer, I know that the HTM5 localstorage is client-side storage technique. I want to get the local storage data on the server-side.

为了从服务器端获取cookie值,我们在ASP.NET中有 Request.Cookie 。有没有像这样的直接在服务器端获取本地存储值的解决方案?请指导我。我使用.net 4.0框架

For getting cookie value from server-side we have Request.Cookie in ASP.NET. Is there any solution like that to take the local storage value directly on the server-side? Please guide me. I am using the .net 4.0 framework

谢谢,
Jibu

Thanks, Jibu

推荐答案

您将需要使用标准HTTP技术将此信息从客户端传递到服务器。使用JavaScript可以填写:

You will need to pass this information from the client to the server using standard HTTP techniques. Using javascript you could fill:


  • 隐藏字段

  • 查询字符串参数

  • POST

  • Ajax呼叫服务器

  • ...

  • Hidden fields
  • Query string parameters
  • POST
  • Ajax call to the server
  • ...

这将取决于你的应用程序的组织方式,存储什么样的信息,它的音量,你是否想重定向,但是在所有情况下,这应该做使用javascript,因为这是访问存储在localStorage中的数据的唯一方法。

It will all depend on how your application is organized, what kind of information is being stored, its volume, whether you want to redirect or not, ... But in all cases this should be done using javascript since that's the only way to access data stored in localStorage.

这篇关于如何在服务器端获取HTML5本地存储值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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