Click here to Skip to main content
15,892,298 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to read selected value of radiobuttionlist control Pin
Rameez Raja2-Jul-08 20:14
Rameez Raja2-Jul-08 20:14 
QuestionCrystal Report Pin
sabaMCA2-Jul-08 12:45
sabaMCA2-Jul-08 12:45 
AnswerRe: Crystal Report Pin
Paul Conrad2-Jul-08 18:35
professionalPaul Conrad2-Jul-08 18:35 
AnswerRe: Crystal Report Pin
BalasubramanianK2-Jul-08 19:37
BalasubramanianK2-Jul-08 19:37 
QuestionHow to redirect to login page when cache item expired Pin
javidot2-Jul-08 12:33
javidot2-Jul-08 12:33 
AnswerRe: How to redirect to login page when cache item expired Pin
AlexeiXX32-Jul-08 16:24
AlexeiXX32-Jul-08 16:24 
GeneralRe: How to redirect to login page when cache item expired Pin
javidot3-Jul-08 4:17
javidot3-Jul-08 4:17 
GeneralRe: How to redirect to login page when cache item expired Pin
AlexeiXX33-Jul-08 17:27
AlexeiXX33-Jul-08 17:27 
You can do something very similar to what you got here

Private Function AlreadyLogin() As Boolean
Dim sKey As String = TextBox_Login.Text.Trim + TextBox_Password.Text.Trim
Dim sUser As String = Cache(sKey)
If (sUser = Nothing) Or (sUser = "") Then
Dim callBack As Caching.CacheItemRemovedCallback = New Caching.CacheItemRemovedCallback(AddressOf MyCacheItemRemovedCallback)
Dim SessTimeOut As TimeSpan = New TimeSpan(0, 0, 15, , 0)
HttpContext.Current.Cache.Insert(sKey, sKey, Nothing, DateTime.MaxValue, SessTimeOut, System.Web.Caching.CacheItemPriority.NotRemovable, callBack)
Session("CurrentUser") = TextBox_Login.Text.Trim + TextBox_Password.Text.Trim
Return False
Else
Label_ErrorMessage.Text = Constants.ERROR_LOGIN_USER_LOGGED_IN
Return True
End If
End Function


If the first time you add something to the session, and session timeout is longer than the cache timeout, then when the cache value is nothing and session isnot nothing then it means that the cache item expired, there you can redirect the user to the login page with FormsAuthentication.RedirectToLoginPage or response.redirect("yourloginpage.aspx") or server.transfer

Alexei Rodriguez

QuestionSave an MS-Excel Pin
Assaf822-Jul-08 11:20
Assaf822-Jul-08 11:20 
QuestionVisual Studio 2008 and FormView Pin
Jacob Dixon2-Jul-08 10:12
Jacob Dixon2-Jul-08 10:12 
AnswerRe: Visual Studio 2008 and FormView Pin
AlexeiXX32-Jul-08 13:50
AlexeiXX32-Jul-08 13:50 
GeneralRe: Visual Studio 2008 and FormView Pin
Jacob Dixon2-Jul-08 15:55
Jacob Dixon2-Jul-08 15:55 
GeneralRe: Visual Studio 2008 and FormView Pin
AlexeiXX32-Jul-08 16:20
AlexeiXX32-Jul-08 16:20 
GeneralRe: Visual Studio 2008 and FormView Pin
Jacob Dixon3-Jul-08 7:20
Jacob Dixon3-Jul-08 7:20 
QuestionRunning an independent C# class along with asp.net website Pin
zomoo2-Jul-08 9:10
zomoo2-Jul-08 9:10 
AnswerRe: Running an independent C# class along with asp.net website Pin
Gayani Devapriya2-Jul-08 18:17
Gayani Devapriya2-Jul-08 18:17 
QuestionMethods being added to web page, not codebehind. Pin
Richard Jones2-Jul-08 7:37
Richard Jones2-Jul-08 7:37 
GeneralRe: Methods being added to web page, not codebehind. Pin
tina->newcoder2-Jul-08 8:03
tina->newcoder2-Jul-08 8:03 
GeneralRe: Methods being added to web page, not codebehind. Pin
Richard Jones2-Jul-08 9:01
Richard Jones2-Jul-08 9:01 
GeneralRe: Methods being added to web page, not codebehind. Pin
AlexeiXX32-Jul-08 13:53
AlexeiXX32-Jul-08 13:53 
GeneralRe: Methods being added to web page, not codebehind. Pin
Richard Jones3-Jul-08 2:48
Richard Jones3-Jul-08 2:48 
GeneralRe: Methods being added to web page, not codebehind. Pin
AlexeiXX33-Jul-08 3:56
AlexeiXX33-Jul-08 3:56 
QuestionHow to set a TIMER ? Pin
tina->newcoder2-Jul-08 7:03
tina->newcoder2-Jul-08 7:03 
AnswerRe: How to set a TIMER ? Pin
Abhijit Jana2-Jul-08 7:21
professionalAbhijit Jana2-Jul-08 7:21 
QuestionRe: How to set a TIMER ? Pin
tina->newcoder2-Jul-08 8:01
tina->newcoder2-Jul-08 8:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.