Click to See Complete Forum and Search --> : How to show confirm dialog box


prasad_agv
April 18th, 2003, 11:39 AM
Hai:

How to show a confirm dialog box to client.
My problem is, I want to show a dialog box with options
OK and Cancel in browser. If user clicks on OK button
I want to delete a record in database. If user clicks Cancel
button i want to dispose the confirm box. How can i know
whether browser client clicked on OK button. Please send
me code, it's urgent.

mail ID : prasad_agv@yahoo.com

fakhir_iqbal
April 20th, 2003, 12:59 AM
I am pasting the simple code for you that confirms the user.
Following code is the example:

call this function from a button or from anywhere according to your requirement. It's a javascript function.

function Test()
{
var a;
a=confirm("Are you sure to proceed...?")
if(a==true)
//perform action what you want
}

prasad_agv
April 21st, 2003, 05:57 AM
thanks for ur reply, but my problem was not that.
i have server control button (<asp:button id="btnSubmit" runat="server" text="Delete">), user clicks
on this to delete a record.

Before deleting the record i want to show him confirmation
dialog box and when user clicks OK button record will
be deleted else not. Here problem is using javascript
we can generate a confirmation dialog box, it's OK but how
asp.net knows whether user clicked OK or Cancel buttons
in javascripts confirmation dialog box. Think it.

- bye

aftermoon
April 21st, 2003, 06:31 AM
http://www.aspalliance.com/aldotnet/examples/confirmdeleteauto.aspx

aftermoon
April 21st, 2003, 06:40 AM
http://www.aspalliance.com/aldotnet/examples/confirmdeleteauto.aspx