0

I need to remove unobtrusive validation in my ASP.net MVC project because I am dynamically creating drop down lists.

I am attempting to use

    @{HtmlHelper.ClientValidationEnabled = false;}

but I get the error "HtmlHelper does not contain a definition for ClientValidationEnabled".

Does anyone know how to fix that or perhaps another solution to this problem? I really only need it disabled for one form.

4
  • Try "EnableClientValidation(bool)": learn.microsoft.com/en-us/dotnet/api/… Commented Jul 30, 2021 at 20:38
  • I assume this is in my controller for the view? Commented Jul 31, 2021 at 21:21
  • right in the view methinks... @{ Html.EnableClientValidation(false); } see this thread: stackoverflow.com/questions/3695186/… Commented Jul 31, 2021 at 23:57
  • 1
    @(ViewContext.ClientValidationEnabled = true) is what worked best for me! Commented Aug 2, 2021 at 12:05

1 Answer 1

2

@(ViewContext.ClientValidationEnabled = true)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.