ASP Cookie [英] ASP Cookies

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

问题描述

嗨-快速问题

我想要一个页面,当用户第一次点击该页面时,系统会询问他们来自哪个地区,例如欧洲,美国或澳大利亚.

我希望根据用户在我的页面上选择的区域来设置Cookie-这样,下次他们访问该网站时,他们不必选择并重定向到相应的网站.有谁知道该怎么做?

感谢您的帮助

Hi - Quick question

I want to have a page that when the user hits it for the first time they get asked what region they are from - eg, europe, usa or australia.

I am lookng to set a cookie based on what region the user has picked on my page - so that the next time they come to the site they dont have to choose and are redirected to the appropriate site. Does anyone know how this would be done?

Thanks for your help

推荐答案

这将使您开始使用cookie.

ASP.NET Cookies概述 [
This will get you started with cookies.

ASP.NET Cookies Overview[^].

You could present them with a drop-down containing a list of countries and ask them to select. Once selected create a cookie. Next time in attempt to read the cookie. If it''s there don''t display the drop-down since you know where they are from otherwise start again.

Note that you might be better to persist this information in a database as cookies do get deleted or are not always allowed.


这篇关于ASP Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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