Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have an asp.net page, some of its controls are created dynamically, these controls are one of the following; textbox, calendar, or dropdownlist.

These controls in some cases, should be validated based on flag read from db?

Is there any way to validate dynamically created controls?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
626 views
Welcome To Ask or Share your Answers For Others

1 Answer

Basically you will need to create your validators via code and attach them to the dynamically created controls via code too. The page will then render with your validators in the page for you.

If validation requires a flag to be read from the db then perhaps use a custom validator which will allow you to set up your specific logic on both the client and server for your specific validation requirements. You don't have to provide client validation if you don't want to.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...