The button controls always use the client-side onclick event themselves for
running the client-side validation. You cannot just use
Button1.Atttrib utes.Add("oncli ck", "[your code]")
Instead, set Button1.CausesV alidation = 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.GetPostBac kClientReferenc e. For example:
Button1.Atttrib utes.Add("oncli ck", "[your code]" +
Page.GetPostBac kClientReferenc e(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 ("Profession al 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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx
<am*******@hotm ail.com> wrote in message
news:eY******** ******@TK2MSFTN GP11.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