I need to ask the user if he/she wants to continue an operation (say, save operation).
So, after the user clicks the Save button, some stuff is checked on the server side. If one condition is met, the user must be asked if he/she wants to proceed.
Based on user’s answer, the postback should be automatically performed carrying the user’s reponse back to the server, so the server will now ask again. Is it possible to do it?
Thanks.
EDIT:
To be more specific, I want this:
-
The user clicks Save button. The postback is performed
-
I need to make some validations/checks on SERVER SIDE (this is important!)
-
In the middle of the postback I want to stop if a certain condition is met and ask the user if he/she really wants to continue.
-
If the user clicks Yes, I need to re-post the request, but now I need to carry the user’s response.
-
If that “certain condition” is met again, I will just ignore it because the user wanted that.
So the solution to add the confirmation dialog right when the button is pressed is not an option because the checks are not simple and require some complex stuff involved (impossible to do it on client side).
Ajax/JS/Telerik, all OK.
You can use
just one of the options…
EDIT:
for your needs you will want to use AJAX, call a method on the server and upon callback open the confirm window.
2nd Edit:
if the server side work isn’t long I would this using AJAX.
AJAX works asynchronously and you want a synchronous procedure, right?
instead of posting back, call an AJAX method from the javascript, which will look something like this:
this way when the server side method finishes the OnSucceedJSFunction on the JS will be called.
in this function you can do something like
if you need to resend the data to the same server side method or to another server side method you can do this again and call a different OnSucceed js function.
Im not sure though about what you want to happen at the end of all the procedure…