Behnam Esmaili
Behnam Esmaili

Reputation: 5967

How to prevent displaying validation summary in Orchard?

i am designing a module in which i planned to implement custom validation with jQuey.i have faced with a problem called Validation Summary that will be displayed on top of every content type Editor page.now i am after a way of getting rid of it. thanks for anyone helping me.best regards.

EDIT:

in fact my problem is not with displaying validation summery.my original problem is as follow:

i have a ContentType called Estate which contains 1-EstatePart 2-AddressPart 3-PersonalInfoPart.when user going to register a new Estate,when user is registered (and loged in) the user information already exist in the data base thus the PersonalInfo Part shouldn't be displayed.in the PersonalInfopart view I decided to show or not show info according to a flag (associated with Model passed to view).but when i submit the form in any case PersonalInfoPart driver attempts to validate the part (which is hidden from user eyes) and displays the validation messages and my first problem is some how related to this one.

Edit 2: What i have tried:

i have tried to render a hidden field for ShouldDisplay property of model and in the driver i have tried to retrieve the ShouldDisplay value from the part.but PersonalInfoPart contains null properties.

my code

protected override DriverResult Editor(PersonalInfoPart part, IUpdateModel updater, dynamic shapeHelper)
    {
        if (part.ShouldDisplay) //ShouldDisplay is always false (and other properties is null)
            updater.TryUpdateModel(part, Prefix, null, null);
        return Editor(part, shapeHelper);
    }

Upvotes: 0

Views: 360

Answers (1)

Bertrand Le Roy
Bertrand Le Roy

Reputation: 17814

Another option may be to simply hide the part using CSS.

Upvotes: 1

Related Questions