Detecting If User Closes The Page?

Jun 7, 2010

Is there a way to detect if the user closes the browser/popup page? I am trying to implement a chat functionality by when the user closes the browser/page, I will update the flag in the database from active to not active. But I cannot seem to find a better way to handle that besides from detecting if the user closes the page.

View 13 Replies


Similar Messages:

Detecting Which User Is Viewing The Page?

Jul 20, 2010

I wondered if there were any 'tricks of the trade' to try and determine the user looking at a specific page. The server which currently hosts our Intranet is configured to use anonymous authentication so most of the usual methods return the account running IIS. I also have the same issue when trying to read the registry using some VB code.

I did get around this by using some VBScript to read the registry and get the username, but I seem to be unable to use this to determine if a column in a GridView should be visible or not. I have a stand-alone page and wondered if this was possible?

View 1 Replies

Call A Server Method When A User Closes The Page?

Jan 4, 2011

I want to remove a temp file from the server after the user close the page (I assumed I don't have this callback on the server by default),

I tried to call a server side method using (ICallbackEventHandler implementation) when the user close the page, but the problem is that the server side method doesn't fire in this case (closing the page), it only response if the page still opened. and I don't prefer to stop closing the page until the server response and send its call back to close the page manually.

View 3 Replies

User Controls :: How To Insert Time Of Session End When User Closes The Browser

Jan 14, 2014

I have written a SP which maintains users log in and log out history,it works fine when any user logs in or clicks on log out, problem is that as per need its not to allowed  to keep the screen idle for 1 minute or more then in the log out column Null value is passed.

SP

Create proc usp_trackuserlogindetails
@username varchar(50) = null,
@command int = 0
as
BEGIN
if(@command = 0)
begin
insert into userlog (USERNAME,LOGIN,LOGOUT) values (@username,Getdate(),Null)

[Code] ....

Here when user manually clicks the log out button then 1(table above) is the output.

When user leaves the screen idle then after 1 minute the page goes to the Login.aspx page if the user tries to do something on the current page,here 2(table above) is the output can i store some hard core value instead of Null like Session expire or the exact session expires time.

View 1 Replies

How To Run Global Function Which Will Run Even When User Closes Browser

Mar 9, 2010

I have an application which works as follows:

Users will purchase Items and as soon as it reaches the products min value it will mail and process to all people who purchased in past but not processed as the min value not reached.

Let's suppose there is products called PRD01 which has min value of 10. A person (Per1) purchased 3 qty but it will not processed immediately as the min value not reached. Now another person (Per2) purchased 7 qty since it has reached the min value it should mail the Per1, Per2 confirming their order.

I have created a function which whill check if the MinValue reached Once the person does checkout. User Order should be processed imediately and if the Min value reached he should be mailed even he has closed the browser.

View 3 Replies

C# - How To Kill The Session When User Closes The Browser Without Logout

May 26, 2010

I am developing one aspnet application in that i am using Sessions. if user login into the application and click on logout here i am closing session.

suppose if the user doesn't click on the logout and he close the browser. how to kill the session when user closed the brower without logout

View 3 Replies

Asp.net - User Closes The Window Using Default Icon Provided In Fancybox?

Apr 18, 2010

I am using jquery.fancybox-1.2.1.js of fancy box in asp.net applicationQ1: In the base page i have datagrid and on combobox. on slection of combobox the datagrid is populated.From the datagrid I open the fancybox when user click on Edit link. I open new page likeIn EditProjectTask.aspx i have the controls in edible mode. Now if user closes the window using default icon provided in fancybox.then if user select some other option from combox the url changes into EditProjectTask?Task= 86Q2: #
From the # datagrid I open the fancybox when user click on Edit link. I open new page likeIn EditProjectTask.aspx i have the controls in edible mode. Now when user updates the the content I want to close the fancybox and also refresh the parent window. I have achieved this using
After update i #But it reloads all the page.Can I use some Ajax call.

View 1 Replies

State Management :: How To Abandon The Session When The User Closes The Browser Window

Jan 7, 2011

How do I abandon the session when the user closes the browser window instead of pressing the logout button in ASP.Net 3.5 application.

View 5 Replies

Remove All Sessions Once The User Leaves The Application/site Or Closes The Browser?

Apr 9, 2010

Is there anyway to actually remove all the sessions once the user leaves the site/application or when he/she closes the browser?

View 11 Replies

State Management :: How To Capture Logoff Time When User Closes Browser

Apr 27, 2010

How to capture logoff time when user closes browser (ie 8, firefox) before sessionout time in a asp.net web application

View 3 Replies

Web Forms :: Store Logout Time In Database When User Closes Tab Or Browser

Jun 16, 2015

I want to kill the session on the browser closing or tab closing and store the Logout time in database using Asp.Net.

I have coded that code in Global.asax page which works only when we Click on Logout Button .but it's not worked on the tab closing /Browser closing.

void Session_End(object sender, EventArgs e) {
SqlTransaction transaction = null;
using (SqlConnection con = new SqlConnection(conn)) {
con.Open();
SqlCommand cmd = con.CreateCommand();
transaction = con.BeginTransaction("Transactions");

[Code] ....

View 1 Replies

Possible To Call A Server-side Event On A Parent Page When A Child Page Closes

Jan 13, 2010

I have a parent page with two data controls. I want to be able to open a child window, do something on it, and when it closes I want to rebind only one of the two data controls on the parent page. I have the control I want to update within an UpdatePanel so would like to call rebind it and call UpdatePanel.Update().

View 2 Replies

State Management :: Handle Session End Event For Web Application When User Closes His Browser?

Oct 20, 2010

I need to handle "session end" event for my web application when user closes his browser. Session is stored in Sql.

View 6 Replies

Security :: Automatic Expiration Of Forms Authentication When User Closes The Browser Windows Without Signing

Aug 28, 2010

can u tell me how to automatically sign out a user if he/she closes the browser window without signing out. I'm using Forms Authentication.

View 1 Replies

State Management :: Session - User Closes Browser, The Session Does Not Get Killed?

Jul 15, 2010

I have a website live in asp.net

now if user closes browser. the session does not get killed.

I spoke with friend and he said that cannot be done as sessions are on server.

but i see banking website who kills session when browser is closed.

View 10 Replies

Visual Studio :: Closes Itself By Opening Aspx-Page Designer After Windows Update?

Aug 17, 2010

I've a problem with my Visual Studio.On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important.

View 8 Replies

Asp.net - Closes The Browser The Flag Is "1"and User Is Locked?

Nov 22, 2010

We have a web application with feature for logging in with credientials The important requirement is once the user logs in he is not allowed to login from any other system or even another browser on same system We used following solution which is mssql based : We have kept " Is_Loggedin" as a column with data type "bit" in a table. when a user logs in we set the flag as "1" sowhen someone tries to log again ,the system is showing the error "The user is already logged in"When user logsout bit turns to "0"indicating user logged out. However this logic is failing in following scenarios Problem scenario:When user closes the browser the flag is "1"and user is locked in or situations when user gets system problem and unable to log out.

View 5 Replies

Web Forms :: Refresh DropDownList On Parent Page When Popup Child Updates Data Or It Closes

Jun 25, 2012

I have a web form that contains a dropdownlist which shows list of cities in it. I have an add button on click of which I am opening a Popup window to open a new page that contains a text box where in i am entering new city name and submit button.

I want that after click submit button the window should be closed and on the parent page the dropdownlist gets refreshed with the new value. I am able to do it but the whole page gets postbacked which I do not want. I have added the dropdownlist in the update panel but not able to do the partial postback.

View 1 Replies

Detecting Javascript During Login Of An MVC App

Jan 24, 2011

My LogIn action originally looked like this:

return new RedirectResult(nameValueCollection["ReturnUrl"]);

But, I would like to know whether the client has JavaScript enabled before the home page loads, so I changed it to this:

return View(new LogInViewModel { ReturnUrl = nameValueCollection["ReturnUrl"] });

And send the following view instead of the instant-redirect:

@model Obr.Web.Models.LogInViewModel
@{
Layout = null;
string noJSReturnUrl = Model.ReturnUrl + (Model.ReturnUrl.Contains("?") ? "&" : "?") + "noJS=true";
}
<!doctype html>
<html>
<head>
<title>Loggin in...</title>
<meta http-equiv="REFRESH" content="1;url=@noJSReturnUrl">
<script type="text/javascript">
window.location = "@Model.ReturnUrl";
</script>
</head>
<body>
<noscript>
Loggin in...<br />
<a href="@noJSReturnUrl">Click here if you are not redirected promptly.</a>
</noscript>
</body>
</html>

The idea is that if the user does not have JavaScript enabled, they see a brief loading message, and the home page loads after a second. If JavaScript is enabled, the page reloads instantly. In the future I could even post to the server the dimensions of the viewport and such. Does this look like it would work? If the window.location command takes longer than a second to run, will it be interrupted by the meta refresh, or does it block that refresh? I am hoping the latter, so I don't need to increase the delay for those non-js people.

I figure my new way adds a little extra weight to the payload of the redirect, but it's not an extra round-trip or anything, is it? The redirect happens anyway, does it not? Update: I neglected to mention a very important point. I do not actually have control over the login screen itself, only the page it posts to. This code is part of a product that relies on an external authentication mechanism.

View 2 Replies

C# - Detecting Non Mobile Browsers

Sep 17, 2010

So I'd like to redirect mobile users to a different page. But instead of trying to detect any number of mobile browsers, I'd just like to see if the user is using IE, Firefox, Safari, Chrome, or Opera; all other users go to the mobile site. My biggest problem is detecting regular Safari from mobile Safari.

View 1 Replies

Detecting Web Browsers' Versions?

Dec 19, 2010

i'm programming an application where an action is done if i access with a version equal or higher than other and another action if i access with a lower version; but the problem is that the lines to indicate the versions doesn´t work. The code is the following:

[Code]....

As you can see, an action should be done if the version is the 9.0 or higher and other if it is lower, but these lines doesn't work and only works the detection of the web browsers (no the versions of them, action that doesn't works).

View 2 Replies

Detecting An Expired Session From Php?

Feb 23, 2011

I'm developing an extra section to a web app that's written in asp.net, but in php - it's mostly done (the two parts don't really communicate with each other outside of a database - the integration is mostly just cosmetic.)

The only issue I have is detecting from the php part when the .net session has expired so that it logs the user out and redirects to the login page.

I believe the asp.net application is compiled, but either way I'm not allowed to alter it so I was thinking maybe the best thing to do would be to make a very small/simple aspx page that outputs true or false which I could call using curl from php (and passing the browser's cookies along.)

Would this even be possible? I'm not sure how session security works on asp.net eg whether one .net application can read another's session variables, but if it's anything like php then it'll be possible.

mypage.php --curl--> checksession.aspx --|
| |
<----------- true / false <---------------

So mypage issues a GET (with cookies from browser) to checksession using curl, checksession simply returns a true or false (or something like that) and mypage redirects to the site's login page if that's false.

The authentication for the php side is already sorted out and is separate to this issue.

So really, what I need to know is can I have just a simple .aspx file that does this check, and if so where would I go to to find out how to program such a simple page?

View 3 Replies

Browser Closes When A Value Is Picked?

Aug 9, 2010

My application is written VS 2008 and .net framework 3.5. Sometimes when a user picks a value in the drop-down menu, this action closes the whole window. I cannot repeat this error on my box, but one of my users gets it consistently. Have anyone ever experienced anything like this?

View 9 Replies

Detecting And Closing Frames Using Javascript

Jul 16, 2010

I'm working on an ASP.NET web application. There's a bill page which has two links to different pdfs of the same bill. When you click on one of the links it takes you to a ViewPDF.aspx page that shows the pdf. There's also an option to view both in a split screen so that you can compare them. When you click on this link it takes you to BillSplit.aspx which has a frameset and two frames that both point to ViewPDF.aspx. This all works perfectly.

The problem is that if an error occurs while pulling up the pdf. The application has an error page that has a few links back into the application. If you use one of these you can go back into the app and continue but now inside the frame. The URL still says BillSplit.aspx but the application is completely unaware of this since frames are HTML elements not asp.net controls.

What I would like to do at this point is detect that you've returned to the application and close the frame you aren't using. Essentially I'd like to redirect you away from BillSplit.aspx and to the page you're actually requesting. I'm pretty sure this would need to be done in Javascript either on the BillSplit page or on the pages that you go to later. So I guess what I'm asking is, is there a way to ensure that the BillSplit.aspx page and it's two frames point only at ViewPDF.aspx?

View 1 Replies

Detecting If Site Is Being Accessed By A Robot?

Feb 15, 2010

I have some geo targeting code whcih I want to behave in a particular way if the site is being spidered by a robot e.g. google etc.

Is there any way to infer this?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved