I wanna to dynamically add the RegularExpressionValidator in c# code behind..
May i know how to do that?
actually i have test the RegularExpressionValidator in html there..It can get d result that i want.
but once i write d RegularExpressionValidator in code behind it, the regular expression didnt appear when i key in wrong number.
May i know how to write dynamic RegularExpressionValidator?Do i need to write txtEvalTitle_onTextChanged ?
Bellow is my code:
TextBox txtEvalTitle = new TextBox();
txtEvalTitle.ID = "txtEvalTitle" + arrCriteriaDetails[i, 5];
txtEvalTitle.Font.Bold = true;
txtEvalTitle.Font.Size = 10;
txtEvalTitle.Width = 30;
txtEvalTitle.Text = arrCriteriaDetails[i, 3];
RegularExpressionValidator rev = new RegularExpressionValidator();
rev.ID = "rev" + arrCriteriaDetails[i, 3];
rev.ControlToValidate = "txtEvalTitle" + arrCriteriaDetails[i, 5];
rev.ErrorMessage = "Please Enter Title No";
rev.ValidationExpression = "[-+]?([1-9]*\\.0+)";
rev.Visible = true;
urgently need ur help..