PC Review


Reply
Thread Tools Rate Thread

Client Side Confirm

 
 
randy.buchholz
Guest
Posts: n/a
 
      4th Aug 2008
I want to use a confirm ("Are you sure?") for deletes but can't seem to get
it to work without using built in commands (delete, insert, etc) If I use a
button click event the process continues to execute just as if I hit OK when
the cancel button is clicked.
Why does this happen and how do I implement a confirmation for events?

<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
onclientclick="confirm('Are you sure?')" Text="Button" />

protected void Button1_Click(object sender, EventArgs e)

{

Button1.Text = "OK";

}

No matter which confirm button I click it executes the Button1_Click


 
Reply With Quote
 
 
 
 
randy.buchholz
Guest
Posts: n/a
 
      4th Aug 2008
Awesome - thanks.

"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:uHNN$(E-Mail Removed)...
> "randy.buchholz" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
>> onclientclick="confirm('Are you sure?')" Text="Button" />

>
> OnClientClick=" return confirm('Are you sure?')" Text="Button" />
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute client-side code _after_ client-side validation? Bogdan Microsoft ASP .NET 2 9th Jun 2008 02:31 PM
DataGrid client-side confirm delete window - why does this work? =?iso-8859-1?B?UultaQ==?= Microsoft ASP .NET 7 26th Oct 2005 09:46 PM
Problem in adding template of server side control using client side scripts Lau Lei Cheong Microsoft ASP .NET 1 13th Oct 2004 11:41 AM
Safe to have client-side AND server-side page load event procedures? Fred Microsoft ASP .NET 2 12th Jul 2004 07:46 PM
Adding custom client-side onClick handler with client-side validator controls Zoe Hart Microsoft ASP .NET 1 8th Jan 2004 10:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:27 PM.