2014年7月13日 星期日

[RESOLVED] How can you add a Label as a Control to validate?


Using any Validator I want to know what type of validator can be used to validate a label, for required field so that it checks wheather the label is blank or not..



Labels typically are not meant to be used to handle or accept any kind of user input and should be used for the purpose of just displaying data (and not handling new data).


I would recommend that you use a TextBox to handle this instead, which can easily be the target of a RequiredFieldValidator. 


If the issue relates to styling the element, then you can use CSS and easily remove the borders of a TextBox to make it appear like a Label.


沒有留言:

張貼留言