Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Confirm text on button
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Confirm text on button
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01482319
Message ID:
01482319
Views:
96
Hello all,

I have a button on a web form that when clicked runs a method. The button code is as follows:
mm:mmButton ID="btnPutOnHold" runat="server" onclick="btnPutOnHold_Click"  
                    Text="Put on Hold" />
I now want to add a confirm messagebox that will allow the user to go ahead and run the method or cancel. I changed the code to the following to accomplish this:
mm:mmButton ID="btnPutOnHold" runat="server" onclick="btnPutOnHold_Click"  
           OnClientClick="return confirm('Are you sure you want to put on hold?')"  Text="Put on Hold" />
This code successfully presents the confirm dialog box when clicked, however, the OnClick event does not fire when 'OK' is clicked.

What am I missing here?

TIA

Bob
Next
Reply
Map
View

Click here to load this message in the networking platform