Last post Jun 07, 2005 12:01 PM by PLBlum
Jun 07, 2005 11:47 AM|RussUK|LINK
_list.ID = System.Guid.NewGuid().ToString();
_validator.ControlToValidate = _list.ID;
_validator.Display= System.Web.UI.WebControls.ValidatorDisplay.Static ;
_validator.ValueToCompare = "Please Select";
_validator.ForeColor = System.Drawing.Color.Red;
_validator.Font.Size = System.Web.UI.WebControls.FontUnit.Large;
_validator.Operator = System.Web.UI.WebControls.ValidationCompareOperator.NotEqual;
Jun 07, 2005 12:01 PM|PLBlum|LINK
Please assign a fixed ID, not a Guid based one. On post back, your list has changed its ID. So ASP.NET has no idea how to associate the value in Request.Forms() which was under the UniqueID of the previous pass with the current object.
In fact, try to assign IDs to every child control in CreateChildControls. This is merely a suggestion as it makes things clearer especially on the client-side.