473,324 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

dont open pop up on session expire

65
Hi all,

I have a page in asp.net. A button click in the page will open a pop-up. I have used btn.attributes.add("onclick", ""); to open the pop-up.

Now if session is expired, it is opening the pop-up window and in the pop-up it is showing the login screen.

Is there any way in which i can avoid pop-up being opened if the session is expired?

Thanks in advance.
Dec 24 '09 #1
4 3473
Frinavale
9,735 Expert Mod 8TB
There is probably a way (send the button click event to the server, check if session is expired, if not send back the JavaScript that opens the child browser) but, for pop up pages I prefer to hide the regular content and display a message when Session has expired instead of redirecting them to the login page.

-Frinny
Dec 24 '09 #2
semomaniz
210 Expert 100+
I would use ajax Modal Popup for this. If the session has expired then it will redirect the page to login.
Dec 28 '09 #3
ThatThatGuy
449 Expert 256MB
Session expires when browser is closed....

your syntax is wrong...

btn.attributes.add("onclick", "");

the second argument of the Add method must contain the client side javascrupt function to be called....

btn.attributes.add("onclick", "hello()");

then you must also create a client function named hello() in the aspx code...

then it will work
Dec 29 '09 #4
Frinavale
9,735 Expert Mod 8TB
Session doesn't exactly expire when the browser closes...

Especially with regards to child browsers being opened. If the child browser is closed and the parent browser is opened then the Session identifier (a cookie) will still exist. This means that the Session is still active. You can configure the Session identifier cookies to be persistent also which means that when the user closes the browser the Session identifier will still be there the next time the user opens the browser.

Session exists on the server. By default session is InProc and times out after 20 minutes. You can configure Session differently so that it doesn't use InProc or doesn't expire for a longer period of time.

So, when you say that the Session expires when the user closes the browser it's not quite right. Session is on the server and (by default) when there is no activity from the user after 20 minutes Session will time out.

-Frinny
Dec 30 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ryan Hubbard | last post by:
I would like to limit multiple logins for a user. How and when does the session id expire? Can I set it so after x minutes of inactivity it would expire. How do I check if session id exists? If...
3
by: Enoch Chan | last post by:
I would like to set a Session variable to a value. In Vbscript it should be Session("ZoomValue")=500 How can I set this session variable by using Javascript? Thanks
1
by: Mike Z. | last post by:
I saved Socket Objects in Session to enhance the performance in my ASP.NET app. I have two questions. 1) Does ASP.NET Logon expire the same moment as Session Expire? I use Form Authentication in...
5
by: tshad | last post by:
If I am using FormsAuthentication, is there a way to check who is logged in? I want to be able to check at any particular time, not just how many people are logged in, but who they are. One...
17
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
0
by: T Ralya | last post by:
My Session restarts on each postback of my ASP.NET page. I'm trying to figure out why. I set up a test application and have verified that the Request Object has one cookie on each entry. This...
4
by: _Mario.lat | last post by:
Hallo, I have a little question: In the function session_set_save_handler I can pass the name of function which deal with session. In Xoops code I see the use of this function like that: ...
2
by: satisharas | last post by:
Hello, I am trying to write a custom session manager in ASP.NET 2.0 using oracle as the backend. I want to know how the session expires in web garden and we are using NLB (a session can be...
20
by: luqman | last post by:
If user login with the login control in ASP.Net 2005 and then just close the browser and then open the browser again, the login status shows, User still Login? Any idea, how to Logout the User...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.