Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 339965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:34:20+00:00 2026-05-12T10:34:20+00:00

When a user is using a Detailsview or Formview in Edit mode, and tries

  • 0

When a user is using a Detailsview or Formview in Edit mode, and tries to leave the current page, I want to trap this and force any changes to be saved, just as if the user had clicked on the Update LinkButton. How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:34:20+00:00Added an answer on May 12, 2026 at 10:34 am

    You can’t do this reliably. Consider the scenario if their computer crashes altogether, or they kick the power cord out. There’s so many ways that a user can leave a page.

    However, you could put in a few safeguards. On any link on the page you could hook up events to do the save before they left. You could also try doing a save after every change in control focus perhaps.

    Another thing you can do is hook into the window.onbeforeunload event and give them a confirmation message asking if they’re sure they want to leave the page, like SO does when you have an unsaved answer. But there’s nothing you can do with this event to force a save.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We alert user using this javascript, now i want to add this functionality to
Using ASP.NET membership, if I want to get information for the current user, I
I want to inject the current user using @Inject @Current User across all layers
I get the memberOf property for my user using this code: DirectorySearcher search =
I want to notify an user using Chrome browser. I need something powerful like
How to extract the path c:/documents and settings/user using Java... Is there any method??
For ASP.NET, I'm using a DetailsView for insert and edit of a record. For
I've got this line my .cshrc.user (using tcsh) set prompt = %{\033[36m%}%m%{\033[32m]%}{`echo $CLEARCASE_ROOT |
I am using a DetailsView control. Here I have both edit and delete buttons.
How to authenticate a user using google account in our website. i want a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.