ASP:Button OnClientClick and Server Side Not working together

G

Guest

Hi,

I have a asp:button which allows a user to delete a record, and I wish to
prompt them with a client side confirmation. The javascript confirm
messagebox does show and the cancel button is fine, however when I click OK,
I expect the Server Side Postback OnClick event to fire, but it does not.
Any Ideas?

Here is the code:

<asp:Button ID="BDelete" runat="server" CssClass="buttonRed" Text="Delete"
Width="80px" OnClick="BDelete_Click" UseSubmitBehavior="False"
Visible="False" OnClientClick="return confirm('Delete Work Order?');" />
 
B

bruce barker \(sqlwork.com\)

you turned off bowser submit (UseSubmitBehavior="False" ), then have the
client onclick do a return, so the asp.net client code to postback is not
called. either enable bowser submit or

OnClientClick="if (!confirm('Delete Work Order?')) return;"

-- bruce (sqlwork.com)
 
G

Guest

Thanks Bruce. I'll go ahead and try this.

bruce barker (sqlwork.com) said:
you turned off bowser submit (UseSubmitBehavior="False" ), then have the
client onclick do a return, so the asp.net client code to postback is not
called. either enable bowser submit or

OnClientClick="if (!confirm('Delete Work Order?')) return;"

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top