Resetting a javascript value on successful save

I am setting a javascript isDirty value to 1 if a change is made in the fields on a form. If the user cilcks a menu item or link that would take them away, I detect if the value is 1 and alert to save.

However, if they press the SAVE button on the page, and the save is successful, I want to reset the value to 0, so that if they click away again, it won't alert them to save again, because they have already saved.

How do I get my .NET code after I determine the save is successful, to then go in and change the isDirty value back to 0?

Thanks!
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

xoperatorCommented:
Hey,

I assume the save operation on your web page requires post back to the server. If so, you have to do nothing because when you are back from post back, the value of the variable will be the same you have initially defined.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xoperatorCommented:
I hope i understood your problem, if it doesn't help you please let me know.
0
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
It is in a radajax panel so it doesn't repost and reset the javascript.
 
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

xoperatorCommented:
I see the problem now.

Ok, what you have to use is the responseEnd method of the radAjaxManager. When the call back is completed you will go through that handler.

0
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
That's not going to work for me as I use the radscript manager and anyway... I don't want this to run every single time it hits, I just want it when the save button is done server side and successful.
Is there someway to register some script that will call the function again after it is completed?
Something akin to this functionality, but where I could call a function that resets the value or something?

Page.ClientScript.RegisterStartupScript(t, scriptName, sb.ToString)
 
0
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
I couldn't ever find a solution to this, so I just did a page refresh on the SAVE button so it would reload the page and reset the isdirty flag. All the other buttons still use the ajax.
Thanks for trying to help.
 
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.