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 3488866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:19:26+00:00 2026-05-18T11:19:26+00:00

I have dialog tha contains a partialview. Is it possible to undo changes that

  • 0

I have dialog tha contains a partialview.
Is it possible to undo changes that the user makes inside the dialog, if the user decides to cancel the dialog and not to save?

If the user now opens the same dialog the changes are still there even if the user cancelled the dialog.
I know that its possible to call the controller and replace the partial view.

Is there any other way?

  • 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-18T11:19:26+00:00Added an answer on May 18, 2026 at 11:19 am

    sanke – you could store the contents of the div in a .data() element when the partialview is first loaded. Then, if it’s cancelled (without saving), just push the .data() back in to div that was created for the dialog.

    actions speak louder than words:

    // the partial getting loaded
    $("#targetDiv").html(data);
    var foo = document.body;
    jQuery.data(foo, "myKey", data);
    

    then on the cancel you could do the reverse:

    // inside the dialog cancel event
    var foo = document.body;
    var data = jQuery.data(foo, "myKey");
    $("#targetDiv").html(data);
    

    give it a try…

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

Sidebar

Related Questions

I have a dialog box that allows users to set hotkeys for use in
I have a dialog that resizes. It also has a custom background which I
I have a MFC dialog with 32 CComboBoxes on it that all have the
I have a dialog in vb6 which changes the values being displayed in its
I have settings dialog with a number of ComboBoxes. More often than not, these
I have a dialog with some fields in it. The user is suppose to
In the WIX I have a dialog where the user could select a folder
I have a dialog where each entry in a JTree has its corresponding options
I have a dialog in MFC with a CStatusBar. In a separate thread, I
I have a UI-dialog something like this: You must choose a book from 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.