Just as Booly said in the beginning of this post. A confirm box IS client side. With Add Attribute your add some functionality from server side on the client side control.
btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');")
If cancel is clicked nothing will happen, there's only a postback if OK is hit,
which is reckon is exactly what you want. of course, if the deletion code is on client side too, you just have to program Confirm on client side. Script will stop executing if CANCEL is hit. So (1) Something isn't clear to you, that's why you don't want to
use attribute.add (2) You are not clear on what functionality you want. A lot of people helped me here, and now I want to return something back. In a earlier post I use registerStartUpScript this is another way to add client side scripting from server-side
code. If you need help about that, I can help you.
Henri
~~~
If you do what you've always done, you'll get what you've always gotten.
Henrikop
Member
365 Points
73 Posts
Re: Message Box
Aug 27, 2003 06:36 AM|LINK
btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');")If cancel is clicked nothing will happen, there's only a postback if OK is hit, which is reckon is exactly what you want. of course, if the deletion code is on client side too, you just have to program Confirm on client side. Script will stop executing if CANCEL is hit. So (1) Something isn't clear to you, that's why you don't want to use attribute.add (2) You are not clear on what functionality you want. A lot of people helped me here, and now I want to return something back. In a earlier post I use registerStartUpScript this is another way to add client side scripting from server-side code. If you need help about that, I can help you.~~~
If you do what you've always done, you'll get what you've always gotten.