Control 'ctl12' of type 'RegularExpressionValidator' must be placed inside a form tag with runat=server. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Control 'ctl12' of type 'RegularExpressionValidator' must be placed inside a form tag with runat=server. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): Control 'ctl12' of type 'RegularExpressionValidator' must be placed inside a form tag with runat=server.] System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +8686387 System.Web.UI.WebControls.BaseValidator.Render(HtmlTextWriter writer) +119 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
string srate = "select case when b.ofc_20=0 and b.ofc_40=0 then b.ofc_bl else case when size1=1 then ofc_20 else case when size1=2 then ofc_40 end end end as ofc from tblsales sc,tblsubport b where sc.subport=b.subportid and sc.refid=' PKL107DEL'"; SqlDataReader chrgdr = objconnection.getDataReader(srate, lblerror); chrgdr.Read(); HtmlInputText itxt = new HtmlInputText(); itxt.ID = "itxt"; cnew.Controls.Add(itxt); RegularExpressionValidator validator = new RegularExpressionValidator(); validator.ControlToValidate = itxt.ID; validator.ValidationExpression = "[0-9]"; validator.ErrorMessage = "enter numbers only"; cnew.Controls.Add(validator);
RegularExpressionValidator
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)