asp.net-mvc – 已经使用相同的参数类型定义了一个名为“Create”的成员
发布时间:2020-05-23 02:58:49 所属栏目: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
}
} (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net中强类型的会话
- asp.net – 奇数编号单元格未添加到Pdf
- .net – DataAnnotations与IDataErrorInfo
- asp.net – 在日历上设置最小和最大日期?
- asp.net – Visual Studio 2010和Visual Studio 2012中的co
- asp.net-mvc – 使用MVC3剃刀的ASP.Net图表控件
- asp.net – 如何在Visual Studio中添加NUnit
- asp.net – 实体框架:如何解决“FOREIGN KEY约束可能导致循
- asp.net-mvc – 什么时候应该在ASP.NET MVC中使用异步控制器
- 增加ASP.net WebForm性能
推荐文章
站长推荐
- 什么可能导致“客户端断开连接”的ASP.NET异常?
- 如何在ASP.NET中混合WebForms和MVC
- 使用ActiveDirectory授权与ASP.NET身份
- asp.net-mvc – ASP.NET MVC将属性“data-messag
- asp.net-mvc – ASP.NET MVC会话过期
- asp.net-mvc-3 – 在MVC 3实体框架中添加多个到多
- asp.net-mvc – 禁止使用[授权]操作过滤器的控制
- asp.net-mvc – 使用Ninject重构依赖注入的ASP.N
- asp.net-mvc – 在ASP.NET MVC中使用控制器和用户
- asp.net-mvc – 如何绘制密码字段就像我们绘制Em
热点阅读
