在具有不同名称的同一控制器中对两个方法的不明确请求

时间:2018-01-05 09:23:35

标签: c# asp.net asp.net-mvc

在同一个控制器中,我有两个动作,具有以下签名:

[MultipleButton(Argument = "save", Name = "action")]
public virtual ActionResult Save(SomeModel someModel)

public virtual ActionResult Attachments(long? Id, string Name, bool IsReadOnly, long IdCategory)

当我使用提交按钮(调用方法Save)时,我发出错误消息,指出方法保存附件之间的请求不明确强>

错误:

  

La richiesta corrente per l'azione'Attachments'nel tipo di   控制器'FirstController'èambiguatra i metodi di azione   seguenti:System.Web.Mvc.ActionResult   SalvaDati(xxx.yyy.Web.UI.Sun.Models.First.FirstModel)in tipo   xxx.yyy.Web.UI.Controllers.FirstController System.Web.Mvc.ActionResult   附件(System.Nullable`1 [System.Int64],System.String,Boolean,   int64)在tipo xxx.yyy.Web.Controllers.FirstController

有什么问题?

0 个答案:

没有答案