Hi all,
I am trying to build my first user control. Basically it's a text box which should be validated against a Regular Expression.
With the static data below the control works fine. My goal is the following:
When the user types the content on the text box it should be validated against a RegExp which will be picked from a DropDownBox. (for instance, if user chooses EMAIL options it should use pattern "\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
I was trying to create Public methods but not sure if this is the way to go. I need to re-use this control and pass the
following parameters:
- width of the textbox;
- ErrorMessage for both Validators;
- ValidationExpression
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TextBoxRegExValidator.ascx.cs" Inherits="TextBoxRegExValidator" %>
<asp:TextBox ID="TextBoxRegExp" runat=&q ...
Go to the complete details ...