Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need this Script's confirm messagebox's value.
If i run this code,I get confirm messagebox when I click yes button so how do get this boolean value true or false from the confirm message box.

What I have tried:

Response.Write("confirm('Are you Sure continue!!')")
Posted
Updated 18-Sep-19 22:14pm

1 solution

You can store the result in a hidden field of a form and submit the form, that will cause the page to refresh and you can read the value from the form. If you don't know how to do this google "javascript store value in hidden field" and "javascript submit form". Or you can use ajax to send the value to your code-behind (probably via a web method). If you don't know how to do this google "jquery ajax webmethod". What solution is best depends on what you want to do with the data and what you want to happen afterwards. This might give you some ideas too

Asking the user to confirm that they want to continue with an action | The ASP.NET Forums[^]
 
Share this answer
 
Comments
Member 14570523 27-Sep-19 2:21am    
Thankyou so much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900