Results 1 to 4 of 4

Thread: Advice on how to prompt for saving edits

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Advice on how to prompt for saving edits

    I want to pick your collective brains on how to do something:

    I have a page that has about 10 fields for display/edit.

    If a user edits any of the data in any way, and trys to navigate away before saving I want a message to display saying "would you like to save your edits, yes (saves), no ignores.

    Is there an easy way to do this?

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497

    Re: Advice on how to prompt for saving edits

    For your body tag:
    onbeforeunload="RunBeforeUnload()"

    Then, make a function called RunBeforeUnload() that returns true if the page should navigate away or false if it should not.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  3. #3
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497

    Re: Advice on how to prompt for saving edits

    Or instead of true/false you can force a postback to occur if that's your thing.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Re: Advice on how to prompt for saving edits

    Thanks I'll play with it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width