开发者

Developing a custom-validation in asp.net for specific control and criteria

There is another relevant question asked Validation Check in asp.net

In the same scenario we need a custom validator control which will alert user for any wrong entry. This will work like th开发者_开发百科is :

  1. Developer will pass the control-name, input-value and format-required
  2. For instance like for textbox it can be: txtName,txtName.Text, allow-alphabets-only
  3. The accordingly format if the user input is invalid he/she will be got prompt.

Please suggest the right way to do the smae.

Thanks in advance.


You've described the default behaviour of all asp.net validators (pass control to validate etc).

What you want to achive (eg, alpha charaters only, or alphanumeric only etc) can be achieved mostly with the RegularExpressionValidator.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜