The button controls always use the client-side onclick event themselves for
running the client-side validation. You cannot just use
Button1.Atttributes.Add("onclick", "[your code]")
Instead, set Button1.CausesValidation = false to prevent it from generating
that code. Then add your code. If you want the client-side validation to
continue, the script is available by calling
Page.GetPostBackClientReference. For example:
Button1.Atttributes.Add("onclick", "[your code]" +
Page.GetPostBackClientReference(Button1, ""))
There are many issues with using client-side validation. In fact, there are
many issues with validation in general. I publish a replacement to
Microsoft's validations because there are so many limitations. Use this link
to see all the problems I found:
http://www.peterblum.com/vam/valmain.aspx.
Even if you don't want my product ("Professional Validation And More" -
http://www.peterblum.com/vam/home.aspx), this list will help you plan your
development efforts better.
--- Peter Blum
www.PeterBlum.com
Email:
PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
<am*******@hotmail.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Hi
Has anyone any experience using client side validation with asp.net forms.
Specifically I'd like to know...
1. How do you attach client side code web controls (a button), like a
JavaScript 'onclick' event for example?
2. Any issues anyone has experienced using client side validation with
asp.net forms?
Thanks in advance
Simon Ames