DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Prompt user to save data

  1. #1
    Join Date
    Oct 2005

    Prompt user to save data

    Is there a working sample of how to prompt user to save data before leaving an ASP.NET web page? Particularly apply to autopostback controls and composite usercontrols. Thanks.

  2. #2
    Join Date
    Dec 2003

    Not really

    How I did it was using Javascript and every field called a function CheckDirty which set a dirty flag when changed and when it went to post back the event in the body BeforeUnload I check the flag and ask a question about saving.

  3. #3
    Join Date
    Oct 2005

    Prompt user to save data

    You can always use the following from the codebehind:

    for example if you have a delete button and you want to confirm the delete:

    this.deleteButton.Attributes.Add("onclick","return confirm('Are You Sure You Want to Delete?');");

    If the user presses No, then in your client side jscript you just return with a false, otherwise you return true, causing a postback event which processes the delete function.

    Hope that helps.

    Romel Evans

Similar Threads

  1. processing additional data when program is running
    By Ervin Rodriguez in forum Database
    Replies: 1
    Last Post: 05-16-2003, 08:45 AM
  2. Web User Control and javascript
    By s in forum ASP.NET
    Replies: 0
    Last Post: 03-26-2003, 03:17 PM
  3. Registry question: Save and read binary data
    By Paulo Costa in forum VB Classic
    Replies: 0
    Last Post: 07-30-2001, 05:15 PM
  4. Data Consumer will not save data
    By GregO in forum VB Classic
    Replies: 0
    Last Post: 12-29-2000, 04:59 PM
  5. Replies: 0
    Last Post: 03-24-2000, 08:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center