This is a migrated thread and some comments may be shown as answers.

Notification Confirm from server side code

3 Answers 217 Views
Notification
This is a migrated thread and some comments may be shown as answers.
dhuss
Top achievements
Rank 1
dhuss asked on 25 Sep 2013, 02:55 PM
I am trying to create a confirm notification that will display during a button click event (server side). What I want to do is:

1. Run the click event on postback
2. Check for existing data in a table
3. If data exists pause code and alert the user with the notification and give them the ability to cancel or overwrite the existing data.
4. Continue running the remainder of code.

I have tried the client "args.set_cancel(!window.confirm" on the client side, but this always fires first. I need something like this to pause execution of vb.net code, alert the user and then continue running the code. Is this even possible?

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 25 Sep 2013, 03:29 PM
Hello,

I advise that you examine the following resources that explain how to achieve similar functionality:
http://www.telerik.com/help/aspnet-ajax/window-using-radconfirm-in-server-code.html
http://demos.telerik.com/aspnet-ajax/window/examples/confirmserverclicks/defaultcs.aspx


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
dhuss
Top achievements
Rank 1
answered on 26 Sep 2013, 04:05 PM
I built a test web using the examples you listed. What I found is the aspx "onclientclick" will always fire first and run the Javascript. If the OK button is clicked then a postback occurs to run the server side code. This is not what I am trying to accomplish. I want to run the server side code first, if a specfic condition is meet then open a radConfirm to allow the user to decide what they want to do. If the user clicks the OK button, finish running the server side code. If they click CANCEL, exit the sub.
0
Marin Bratanov
Telerik team
answered on 27 Sep 2013, 08:57 AM
Hi,

Have you examined the first article I linked: http://www.telerik.com/help/aspnet-ajax/window-using-radconfirm-in-server-code.html? It offers three different ways to do this.

The second one I linked shows a different approach that can spare you one postback.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Notification
Asked by
dhuss
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
dhuss
Top achievements
Rank 1
Share this question
or