TextBox objtext = new TextBox();Page.Form.Controls.Add(objtext);RequiredFieldValidator objReq = new RequiredFieldValidator();objtext.ID = "MyTextBox";objReq.ControlToValidate = objtext.ID;objReq.ErrorMessage = "Please tell us some thing";Page.Form.Controls.Add(objReq);
Tags: dynamic-validation, dynamic-controls
.net | asp.net | c#
Related posts
Comments
Add comment
Try, Strive and Struggle are the keys of my hope. When there is no hope, no success. So keep hoping and keep winning. No idea how true that statement is, as I myself is losing the biggest hope of mine. So do it on your own risk :)