在会话超时方面需要帮助 [英] Need help with Session timeout

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

问题描述

大家好,我做了一个简单的项目,允许用户转到另一个页面,并在该页面中显示他的名字,但是过一分钟,该页面将直接返回到索引页面.我该如何确定已满足分配的时间以将页面重定向回索引页面?希望您能给予积极的回应.谢谢.

索引页代码

Hello guys, i made a simple project that allows a user to go to another pages and in that page his name is displayed but after a minute the page will directly go back to the index page. How do i make a condition to determine that the alloted time is already met to redirect the page back to the index page? Hoping for your positive response. Thanks.

index page code

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Session("name") = TextBox1.Text
        Response.Redirect("profile.aspx")
    End Sub



个人资料页面



profile page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
dim timeLogger as integer
        Label1.Text = Session("name")

        Session.Timeout = 1
        timeLogger = Session.Timeout
        Label2.Text = timeLogger

        'If timeLogger = timeLogger Then
        '    Response.Redirect("index.aspx")
        'End If
    End Sub

推荐答案

如何在ASP中会话超时时重定向到另一个页面.NET(当页面包含Ajax UpdatePanel时) [ [
How to Redirect to Another Page when Session Timeout in ASP.NET (when pages contain Ajax UpdatePanel)[^] should help you out.
This[^] may offer some assistance as well - though in this article, you are taken to the login page on timeout.


这篇关于在会话超时方面需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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