Azure的ACS +表值存储 [英] Azure ACS + Form value storage

查看:91
本文介绍了Azure的ACS +表值存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的ASP.net MVC 3网站(天青过主办)使用Azure的ACS,方案是这样的:
用户首先进入我的网站,填补了一个字段的形式,那么就需要选择一个提供者和登录,但首先我要存储的字段值,所以当他们回来,从登录我能够创建一个配置文件与该值为loged的用户。

I'm using Azure ACS in my ASP.net MVC 3 website (hosted in Azure too), the scenario is this: A user first enters my website and fills a one field form, then they need to chose a provider and login, but first I want to store the field value so when they come back from login I'm able to create a profile with this value for the loged in user.

所以我相信,当他们第一次进入该网站,然后离开登录并进入现场再次这是两个不同的会话是吗?这就是原因使用会话状态中存储的数据(通过SQL Server)未present当他们登录我说的对后回来?如果这是真的,这将是最好的方法呢?如果没有的话,我做错了什么存储临时数据吧?

So I believe when they first enter the site and then leaves to login and enters the site again those are two different sessions am I right? and that's the reason the stored data using session state (through SQL Server) is not present when they come back after login am I right? if this is true what would be the best approach then? if not then I'm doing something wrong storing temp data right?

感谢

更新:
我发现HttpContext.Application状态作品保存数据,还是我不知道,如果是使用它在控制器考虑到它在Azure中一个不错的主意,将其生产的正常工作?

UPDATE: I have discovered that HttpContext.Application state works keeping the data, still I'm not sure if it's a good idea to use it in a controller considering it's in Azure, will it work on production properly??

推荐答案

另一种方法是,以节省您需要在数据库通过周围的任何数​​据,而只是通过周围的一些ID引用到数据库中记录。你会通过这个ID来IP和背部通过wctx(麦克如上所述)。

Another approach would be to save whatever data you need to pass around in the Database, and just pass around some ID that refers back to the database record. You'll pass this ID to IP and back through wctx (as Mike mentioned above).

这将解决URL的长度有限的问题(如果你的数据是非常大)。当然,你需要管理这些数据的删除,但是这不应该是困难的。

This will solve the issue of limited length of URLs (in case your data is very large). Of course you would need to manage deletion of this data, but this shouldn't be hard.

这篇关于Azure的ACS +表值存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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