除了MVC中的url参数之外,还有哪些其他可能的方法来避免会话或cookie [英] What are other possible ways to avoid session or cookies, other than url parameters in MVC

查看:90
本文介绍了除了MVC中的url参数之外,还有哪些其他可能的方法来避免会话或cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说有视图会显示基于参数的信息(数据过滤),

我们称之为FilterClass,它包含几个字段,例如



List< string>姓名

列表< string> Ids

List< string>国籍



和许多其他人,因为结果可能很多,涉及到分页,每页10条记录。

分页是通过使用来完成的$ .get,用于发送参数,最初过滤器只有几个小字段,没有列表,一旦列表被添加到类中,事情发生变化,因为现在过滤器可能太多了。



可以使用哪些替代方法来避免MVC应用程序中的会话,cookie,缓存,

当需要传递的信息可能是极端大到达url max size(maxUrlLength) ,

可以增加,但系统无法测量列表的大小。



替代解决方案我有听说过,被告知是使用tempdata,session,cache,Others,

但是我试图避免任何一种持久性。

解决方案

.get,并用于发送参数,最初过滤器只有几个小字段,没有li sts,一旦列表被添加到类中,事情发生了变化,因为现在过滤器可能太多。



可以使用哪些替代方法来避免会话,cookie,缓存在MVC应用程序中,

当需要传递的信息可能达到极大值达到url max size(maxUrlLength),

可以增加但是系统中没有办法测量列表的大小。



替代解决方案我听说过,被告知使用tempdata,session,cache,其他,

但我试图避免任何类型的持久性。


对于 Web缓存,本文将对此进行详细说明:http://www.mnot.net/cache_docs/ [ ^ ]。



问题的其他部分似乎对我没有多大意义 - 请看我对这个问题的评论。此外,还不清楚您的问题如何与过滤字段,传递它们,URL大小限制和提到的其他问题相关。如果您解释这些问题,可能会成为讨论的问题甚至是获得更多帮助的机会。



-SA

Lets say there is view that will show information based on parameters(data filtering),
lets called it a FilterClass which includes several Fields such as

List<string> Names
List<string> Ids
List<string> Nationality

and many others, since results could bee a lot there is paging involved, 10 records per page.
Paging is done by using $.get, and used to send parameters, initially the filter had just a few small fields, no lists, once lists were added to the class, things changed since now filters could be too many.

What alternatives could be used in order to avoid session, cookies, cache in MVC applications,
when information required to pass could be extremley big reaching the url max size (maxUrlLength),
which could be increased but there is no way in the system to measure how big the lists could be.

Alternatives solutions I have heard, been told is using tempdata, session, cache, others,
but I am trying to avoid any kind of persistence.

解决方案

.get, and used to send parameters, initially the filter had just a few small fields, no lists, once lists were added to the class, things changed since now filters could be too many.

What alternatives could be used in order to avoid session, cookies, cache in MVC applications,
when information required to pass could be extremley big reaching the url max size (maxUrlLength),
which could be increased but there is no way in the system to measure how big the lists could be.

Alternatives solutions I have heard, been told is using tempdata, session, cache, others,
but I am trying to avoid any kind of persistence.


As to the Web cache, this is explained in detail in this article: http://www.mnot.net/cache_docs/[^].

Other parts of the question does not seem to make much sense to me — please see my comment to the question. Also, it's not clear how your question can be related to "filtering fields", passing them, "URL size limitation" and other issues mentioned. If you explain those concerns, it may become a matter of discussion or even a chance to get more help.

—SA


这篇关于除了MVC中的url参数之外,还有哪些其他可能的方法来避免会话或cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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