G
Guest
The problem is when I add a control using Controls.AddAt(index, control). On
the first page postback it appear to work fine but after the first postback
the last control in the naming container appears to be replaced with the
control that I'm adding in addition to adding the control at the given index.
After each additional postback a further control gets replaced until the
viewstate becomes corrupt and the page errors. If I add the control with
Controls.Add(control) I don't get this problem after multiple postbacks but
the control isn't added where I need it to be.
I'm adding the control from the Validate function from the IValidator
interface from an object that is added to the page's validators collection in
the page's onload event.
the first page postback it appear to work fine but after the first postback
the last control in the naming container appears to be replaced with the
control that I'm adding in addition to adding the control at the given index.
After each additional postback a further control gets replaced until the
viewstate becomes corrupt and the page errors. If I add the control with
Controls.Add(control) I don't get this problem after multiple postbacks but
the control isn't added where I need it to be.
I'm adding the control from the Validate function from the IValidator
interface from an object that is added to the page's validators collection in
the page's onload event.