Calling server side function from client side alert

Hi,

I am developing an ASP.Net application in which I am giving client side alert to the user with OK and Cancel buttons. Can I call a server side function from the click of this button?
For e.g. I have to give user alert "Do you want to save record" with Yes/No button. On Yes button click it should go to the server and save the record. Can I call some server side function from the Yes button click?
Any help in this regard will be highly appreciated. Thanks in advance.
Ashish
0
ashishj
9/26/2003 7:19:43 AM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 5 followers.

💬 1 Replies
👁️‍🗨️ 1029 Views

I would create a button control, say Button1.

set Button1.visible=False
then, in script:
if (confirm("Do you want to save record")) Button1.click();
Then handle the event in Button1_Click() on the Server.
0
rox
9/26/2003 4:00:16 PM