开发者

Passing a guid by actionlink

I have an (nothing fancy) for editing a different model by a Guid. I made a ActionResult "Edit" with a param (Guid Bedrnr), Still another Edit (int id) is available. When I call this ActionResult I get an error message about

ambiguous between the following action methods: System.Web.Mvc.ActionResult Edit(Int32) on type D开发者_如何学编程aisyMatchMaker.Controllers.BedrijfsGegevensController System.Web.Mvc.ActionResult Edit(System.Guid) on type DaisyMatchMaker.Controllers.BedrijfsGegevensController

 @Html.ActionLink(@item.Bedrijfsnaam.ToString(), "Edit", "BedrijfsGegevens", null, new { bedrijfsnummer = (Guid)item.Bedrijfsnummer })

Why?? And what is the proper ActionLink??

Cheers Hans


The issue is simply that you have two Actions with the same name and same parameter count. Try changing the name of one of your Action methods and it should work properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜