在ASP.Net移动Web应用程序中存储viewstate的最佳方法是什么?

时间:2021-12-11 16:57:24

I'm curious what techniques you find to be the best for storage and maintaining of viewstate with respect to an ASP.Net application running within a mobile web browser (i.e. Treo with Windows Mobile, or Blackberry Curve web browser).

我很好奇你在移动网络浏览器中运行的ASP.Net应用程序(即使用Windows Mobile的Treo或Blackberry Curve Web浏览器)中找到的最适合存储和维护viewstate的技术。

2 个解决方案

#1


2  

If you use the mobile controls, the view state can actually be stored in the session instead so it doesn't eat bandwidth. See this link http://msdn.microsoft.com/en-us/library/cteh3e77.aspx for more about mobile controls and maintaining state.

如果您使用移动控件,视图状态实际上可以存储在会话中,因此它不会占用带宽。有关移动控件和维护状态的更多信息,请参阅此链接http://msdn.microsoft.com/en-us/library/cteh3e77.aspx。

Hope this helps.

希望这可以帮助。

#2


1  

Some of the mobile controls still store settings in ways that older phones may not support. If you are targeting older mobile phones, you should either change your session settings to cookieless or start using the HiddenVariables collection instead (which older phones can use). We used hiddenvariables since changing our whole site over to cookieless was not an option. However, hiddenvariables can only be strings so you will need to be ready to serialize objects into hidden fields as strings, just like viewstate does.

某些移动控件仍以旧手机可能不支持的方式存储设置。如果您要定位较旧的手机,则应将会话设置更改为无Cookie或开始使用HiddenVariables集合(旧手机可以使用)。我们使用hiddenvariables,因为将整个站点更改为cookieless不是一个选项。但是,hiddenvariables只能是字符串,因此您需要准备好将对象序列化为隐藏字段作为字符串,就像viewstate一样。

#1


2  

If you use the mobile controls, the view state can actually be stored in the session instead so it doesn't eat bandwidth. See this link http://msdn.microsoft.com/en-us/library/cteh3e77.aspx for more about mobile controls and maintaining state.

如果您使用移动控件,视图状态实际上可以存储在会话中,因此它不会占用带宽。有关移动控件和维护状态的更多信息,请参阅此链接http://msdn.microsoft.com/en-us/library/cteh3e77.aspx。

Hope this helps.

希望这可以帮助。

#2


1  

Some of the mobile controls still store settings in ways that older phones may not support. If you are targeting older mobile phones, you should either change your session settings to cookieless or start using the HiddenVariables collection instead (which older phones can use). We used hiddenvariables since changing our whole site over to cookieless was not an option. However, hiddenvariables can only be strings so you will need to be ready to serialize objects into hidden fields as strings, just like viewstate does.

某些移动控件仍以旧手机可能不支持的方式存储设置。如果您要定位较旧的手机,则应将会话设置更改为无Cookie或开始使用HiddenVariables集合(旧手机可以使用)。我们使用hiddenvariables,因为将整个站点更改为cookieless不是一个选项。但是,hiddenvariables只能是字符串,因此您需要准备好将对象序列化为隐藏字段作为字符串,就像viewstate一样。