Custom Controls and ASP.NET Validation (Client Side)#
It turns out that when I said:
Turns out it is as simple as adding [ValidationPropertyAttribute("­Text")] to your class definition for the custom control. That's easy!
it really wasn't that easy, at least to get client side support for asp.net validators to work.

After a lot of research, and a bunch of looking through the page output I figured out what must be done.

If you have a custom server control and it is named "MyDateTime1", then the HTML element that you want to check in your client side validation must also be named "MyDateTime1". In my control, I would output a bunch of different elemnts, using things like ClientID + "_textbox" and ClientID + "_Icon" etc... All I had to do was make sure the textbox (which is what I wanted to run the client side validation against) was named simply this.ClientID and presto!
Categories:
Thursday, July 07, 2005 6:28:43 AM (Central Standard Time, UTC-06:00) #    Comments [1]  | 

 

Thursday, July 07, 2005 6:31:48 AM (Central Standard Time, UTC-06:00)
This is a good resource:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspplusvalid.asp
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

All content © 2008, Christopher May, Inc
Open Job Positions
On this page
Google Ads
This site
Calendar
<December 2008>
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 1.9.6264.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: