DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    1

    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
    Posts
    78

    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
    Location
    California
    Posts
    10

    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, 02: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, 03:59 PM
  5. Replies: 0
    Last Post: 03-24-2000, 07:06 AM

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links