I will keep this possble but its brief as much as destroying my head. I have a user control with the label and area I add dynamically user controls on a page on the runtime There can be many user controls that are dynamically created from the data obtained from the data base. The data describes the name of the label and if the text box should be completed i.e. it is necessary that I have submitted one on the main page that contains a verification group. All beliefs on user controls have the same verification group. So far so good I hope.
User Control is a RequiredFieldValidator for the text box and looks like this all. Validator enabled by default
& lt; ASP:. Text box id = "dfControl" runat = "server" text = "" tooltip = "ucsAlphanumericEntryDC" width = "95%" CausesValidation = "true" /> & Lt; ASP: RequiredFieldValidator id = "rfvContol" runat = "server" errorCare = "value is required" EnableClientScript = "true" ValidationGroup = "ValidateContols" ControlToValidate = "dfControl" display = "dynamic" enabled = "true" and gt; & Lt; / ASP: RequiredFieldValidator & gt; When I load the control dynamically, check the parameters to tell me whether the field is required or not. The parameter is from the database that represents the control that I'm going to draw. Field is not a required field I disabled attestation in page_preRender .. Also try this in load then
if {rfvContol.EnableClientScript = false. (DisplayRequired!); RfvContol.Enabled = false; DfControl.CausesValidation = false; } So far it is so good that all this task only displays with the required user sets for client-side verification, sets it to True, the Velliter has been enabled.
While posting a page with a submit button, on which I am the same verification group as user control, I check ISValid on submission and if its false I do not save anything but when on the client client Re-presents .. I have an error message on all user controls, saying that they are necessary ... even though I disabled some of them where there was no need. See the state control which I have on default on the value.
I also tried not redrawing the control with the authors by closing the code in a if (! IsPostBack)
Any person has any idea of the reason that the validated fire when they First pages are disabled on load, but are not disabled on postback.
Thanks Mick
visible = false to the server Try setting, it works for me HH Or you can use client-side validation (valid, incorrect);
Comments
Post a Comment