c# - Remote validation with a select input in MVC CORE -
hy , thank taking time read question.
i'm working on mvc core website , i'm try add remote validation entity framework on select input.
unfortunately seems doesn't work... here code :
html select -->
<select asp-for="idsociety" asp-items="@(new selectlist(@viewbag.listofsociety,"id", "name"))"></select>
c# viewmodel -->
[remote("verifynameservice", "parameter", additionalfields = "servicename", errormessage = "ce nom de service existe déjà pour cette société !")] public int idsociety { get; set; }
thank in advance help.
i believe have arguments backwards. it's trying call action named verifynameservice
on controller named parameter
.
here constructors remoteattribute
in core:
public remoteattribute(string routename); public remoteattribute(string action, string controller); public remoteattribute(string action, string controller, string areaname);
Comments
Post a Comment