asp.net-mvc – 已经使用相同的参数类型定义了一个名为“Create”的成员
发布时间:2021-03-31 03:33:13 所属栏目:asp.Net 来源:互联网
导读:这个问题在这里已经有一个答案: GET and POST methods with the same Action name in the same Controller7个 我有两种方法和不同的http动词: public class ProductImageControll
这个问题在这里已经有一个答案:>
GET and POST methods with the same Action name in the same Controller7个
public class ProductImageController : Controller { [HttpGet] public ViewResult Create(int productId) { return View(productId); } [HttpPost] public ViewResult Create(int productId) { } } 但获取错误:
解决方法您不能在同一范围内具有相同签名的多个方法,例如相同的返回类型和参数类型.编辑- public class ProductImageController : Controller { [HttpGet] public ViewResult Create(int productId) { return View(productId); } [HttpPost] [ActionName("Create")] public ViewResult CreatePost(int productId) { //return a View() somewhere in here } } (编辑:4S站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – ASP.NET MVC中的Windows Live ID
- global-variables – MVC 3 Razor _ViewStart中的公共变量
- ASP.NET缓存的方法和最佳实践
- asp.net-mvc – MVC应用程序中的随机数生成
- 向.NET电子邮件添加附件
- Asp.net webForm设置允许表单提交Html的方法
- asp.net-mvc – 如何正确识别vs2008版本级别?
- asp.net – 从启用AJAX的WCF服务返回错误详细信息
- asp.net – Web Forms MVP项目有哪些好的资源?
- asp.net-mvc – ASP.net身份在删除外部帐户后停止分发外部C
推荐文章
站长推荐
- Asp.net超链接控件相当于
- asp-classic – 如何使用AES在VBScript中进行加密
- .net – Viewstate隐藏字段如此之大,一切都会崩溃
- ASP.NET – 可以从服务器代码触发回发吗?
- asp.net – 注册.NET 4.5 IIS 10 Windows 10
- asp.net-mvc-3 – MVC3视图继承不可能?
- asp.net-mvc-4 – MVC4 RC脚本捆绑很慢
- asp.net – MVC 4导出到CSV – 另存为对话框在Ch
- .net – DNU发布 – 来自MSBuild的no-source
- asp.net – Web部署安装程序(MSI)中没有“IIS 7部
热点阅读