且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我想获取并编辑MVC中当前登录用户的详细信息

更新时间:2023-12-04 08:37:10

您有两个编辑操作,MVC不知道要调用哪个。如果只在查看页面时使用一个,而在提交表单时使用另一个,则将[HttpGet]置于一个上方,将[HttpPost]置于另一个上方。如果两者都不是表单提交,那么删除不带参数的编辑操作。



我们无法确切地告诉您发布的代码应该如何流程或它应该做什么,所以你可能需要进一步更新。
You have two Edit actions and MVC doesn't know which one to call. If one is only used when the page is viewed and the other when a form is submitted then put [HttpGet] above one and [HttpPost] above the other. If neither are for form submission then remove the Edit action that takes no parameters.

We can't really tell from what you've posted how your code is supposed to flow or what it is supposed to be doing so you may well need to make further updates.