ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to remove awe build-in validation
Title:
B
I
{code}
?
I have ajaxradioList and validation message: @Html.Awe().AjaxRadioListFor(x => x.CompanyId).Url(Url.Action("GetCompBySingleGroup", "Autocomplete")).Combobox(l => l.Caption("Company...")).Parent("GroupId").Value(Model.Company) @Html.ValidationMessageFor(x => x.CompanyId) But when I enter into this combobox some value, which is not contained in its value list, I recieve validation error, which I hadn't created: "The field CompanyId must be a number.". Looks like it's some build-in validation. Is there any way how to remove it? I can't remove validation placeholder, as I need it for other stuff. Field "CompanyId" in input model doesn't have any validation attributes
Save Changes
Cancel
Aleksander Seregin
asked at 15 Oct 2017
I tried to add .UnobsValid(false) at the end of AjaxRadioListFor, but when I use ModelState.AddModelError("CompanyId", "It's wrong!"); My error message is replaced by "The value 'ggg' is not valid for GroupId" How to prevent that?
at 15 Oct 2017
Aleksander Seregin
Answers
B
I
{code}
?
that's `.net`, CompanyId is of type `int` I presume, so you can't assign a string value to it; you can try without awesome and you'll get the same error. You can use type `object` instead.
Save Changes
Cancel
Omu
answered at 15 Oct 2017
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK