Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > HowTo Use RegularExprValidator and DataList

Reply
Thread Tools

HowTo Use RegularExprValidator and DataList

 
 
HelpForNewbie
Guest
Posts: n/a
 
      10-01-2004
I have a datalist of parameters that I need to validate. Each parameter
(row) can represent a different data type. Some are dates, some are patterns
as \d{2}[-]\d{2}. All are kept in the same table as varchar columns.

How I would like to do is to add a new column to this table that contains
the regular expression valiadation string in order to validate the associated
value. For Example:

ParmName ParmValue RegExp
StartDate 10/01/2004 [012]?\d\/[0123]?\d\/[0]\d
ContactTel 999-999-4444 \d{3}[-]\d{3}[-]\d{4}
....
....

Is is possible to have the Reg Validator within the EditItem template so row
each contains the specific reg expr for validation? Could the RegExp column
be feed into the ValidationExpression property for each row?

Thank you,

Jim
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      10-02-2004
Hi,

yes it should be. Just place the RegExpValidator declaration into separate
column on the table (and set the ControlToValidate to point the control,
which of course needs to be a input control, you want to validate). You can
in ItemDataBound event of the DataList access the validator with per-row
idea and apply suitable validation expression.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke



"HelpForNewbie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a datalist of parameters that I need to validate. Each parameter
> (row) can represent a different data type. Some are dates, some are

patterns
> as \d{2}[-]\d{2}. All are kept in the same table as varchar columns.
>
> How I would like to do is to add a new column to this table that contains
> the regular expression valiadation string in order to validate the

associated
> value. For Example:
>
> ParmName ParmValue RegExp
> StartDate 10/01/2004 [012]?\d\/[0123]?\d\/[0]\d
> ContactTel 999-999-4444 \d{3}[-]\d{3}[-]\d{4}
> ...
> ...
>
> Is is possible to have the Reg Validator within the EditItem template so

row
> each contains the specific reg expr for validation? Could the RegExp

column
> be feed into the ValidationExpression property for each row?
>
> Thank you,
>
> Jim



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entering DataList EditItemTemplate from Outside of the DataList Luis Esteban Valencia ASP .Net 1 01-06-2005 07:32 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM
Click event in a datalist to post back datalist properties Steve Lloyd ASP .Net 1 05-26-2004 04:07 AM
DataList in DataList acko bogicevic ASP .Net 2 11-11-2003 08:31 AM
Datalist in Datalist How? Gönen EREN ASP .Net 0 08-22-2003 02:41 PM



Advertisments