View Single Post
  #1 (permalink)  
Old September 2nd, 2012, 04:16 AM
sophia sophia is offline
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile validation class like css class

Hello all,

In web forms we need to use validation controls at many stages, and in a complete website we have many pages which need validations.

But at every page we have to use those validation controls with full definition. So isn't there a way to use validation controls as we do with css classes, just define once and use anywhere.

for ex, for textbox and ragular expression I want to write code like this

<asp:TextBox ID="TextBox1" runat="server" ValidationClass="Regular(Email)"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" ValidationClass="Regular(ContactNo)"></asp:TextBox>
if it is possible anyhow.

Please tell me if this/or similar method is possible.

Many thanks
Reply With Quote