I am trying to return a regular expression from code
behind to server control in aspx page. Problem is
regularexpressi onvalidator tag interprets string
incorrectly.
// aspx
<asp:regularexp ressionvalidato r validationexpre ssion="<%#
getTimeExpr()%> "
// code behind
_tiExpr = @"^((0?[1-9]|1[012])(:[0-5]\d){0,2}( [aApP][mM]))
$|^([01]\d|2[0-3])(:[0-5]\d){1,2}$|^(hh: mm)$";
public string getTImeExpr(){
return _tiExpr;
}
if I paste the expression directly into tag property it
works fine.
Any ideas, thanks in advance
behind to server control in aspx page. Problem is
regularexpressi onvalidator tag interprets string
incorrectly.
// aspx
<asp:regularexp ressionvalidato r validationexpre ssion="<%#
getTimeExpr()%> "
// code behind
_tiExpr = @"^((0?[1-9]|1[012])(:[0-5]\d){0,2}( [aApP][mM]))
$|^([01]\d|2[0-3])(:[0-5]\d){1,2}$|^(hh: mm)$";
public string getTImeExpr(){
return _tiExpr;
}
if I paste the expression directly into tag property it
works fine.
Any ideas, thanks in advance