如何登入及登出 [英] How to login and logout

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

问题描述

我使用自定义登录设计创建了一个表单.
它将检查数据库中输入的用户名和密码,当提供的详细信息可用时,它将移至下一页.
它运作良好.但是,现在我遇到了注销的情况.
当我使用Javascript或ASP.NET编码编写Script时,它将使其移至主页.但是,浏览器历史记录可用,当我们按后退"按钮时,它又进入了页面.
请帮助我..

I created a form with my custom login design.
It will check the database for entered username and password and it will move to next page when the provided details are available.
Its working well. But, now i struck in a situation to logout.
When i write Script using Javascript or ASP.NET coding, it will make it to move to home page. But, browser history is available and when we press back button it was getting into the page again.
Please help me..

推荐答案

每天至少要问五遍,并在网上记录下来.如果正确编写页面,则尝试刷新页面将无法加载任何页面.但是,您还需要关闭浏览器缓存以停止提供缓存的版本.

将这些行添加到html meta部分中

< META HTTP-EQUIV ="CACHE-CONTROL"; CONTENT ="NO-CACHE">
< META HTTP-EQUIV ="EXPIRES"; CONTENT ="0">

并在page_load中编写此

Response.Cache.SetCacheability(HttpCacheability.NoCache);
this is asked at least five times a day and is documented all over the web. If you write your pages properly then any page will fail to load if you try to refresh it. But, you also need to turn off browser caching to stop a cached verson being available.

Add these lines in the html meta section

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="EXPIRES" CONTENT="0">

and in the page_load write this

Response.Cache.SetCacheability(HttpCacheability.NoCache);



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

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