Custom Controls and ASP.NET Validation (Client Side) (MORE)#
It turns out that when I said:
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!
It really isn't that easy.

I think this worked before because I was created HTML elements, and not ASP.NET Webcontrols. I am trying to basically do the same thing, and let me tell you, it isn't working. I am getting an error saying that there are more than 1 control w/ the same name. The problem (I believe) is that container control is registered w/ asp.net, and when I dynamically add an asp.net textbox with the same name as the parent control, it flips out. With my other control I was just adding an HTML textbox.
Categories:
Friday, September 09, 2005 12:16:28 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

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
<September 2005>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678
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: