ASP.NET维护搜索历史中的应用 [英] ASP.NET Maintaining Search History in an application

查看:101
本文介绍了ASP.NET维护搜索历史中的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我收到了面试问题。

Recently i received an interview question.

如何保持搜索每天的搜索历史记录在asp.net应用程序?

How to maintain search day to day search history in an asp.net application?

下方哪之一将是正确的选择?

Which one of the below would be the right choice?

1)Cookies 2) Sql Server 3) Session State

我想正确的选项可能被好心Cookies.Please分享您的想法。

I guess the correct option could be Cookies.Please kindly share your thought.

推荐答案

SQL Server是保持任何的最可靠的方法。饼干一般不能依赖于此,和会话过期并丢失所有数据。

SQL Server is the most reliable way of maintaining whatever. Cookies cannot generally be relied upon, and sessions expire and lose all data.

所以,问题归结为:如果您需要mainain长期的历史纪录,与SQL Server去。如果你想显示一个特定的用户搜索什么,去会话(或饼干,但他们有些大小限制)。

So the question boils down to: if you need to mainain long-term historical records, go with SQL Server. If you want to show what a particular user has searched for, go for session (or cookies, but they're somewhat size-limited).

这篇关于ASP.NET维护搜索历史中的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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