asp.net-mvc – 已经使用相同的参数类型定义了一个名为“Create”的成员
发布时间:2021-03-31 01:12:35 所属栏目: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-mvc – 使用AD的ASP.NET MVC表单Auth在本地工作但在
- ASP.NET:将内容注入所有Response流
- asp.net-core – 加密ASP.Net Core中的连接字符串和其他配置
- asp.net – 在渲染到位图之前缩放WPF内容
- ASP.NET MVC编辑器模板和Html.EditorFor(…) – 如何消除类
- 什么是链接服务器的ASP.NET连接字符串格式?
- asp.net-mvc-3 – Orchard CMS DataAnnotations – 客户端验
- asp.net – 如何检查SQL Server代理是否正在运行
- asp.net – coldfusion和.net上的单点登录
- asp.net – 使用/ signalr / ping调用时使用长轮询
推荐文章
站长推荐
- 是否可以使用ASP.NET ScriptManager来使用Window
- 来自ASP.NET MVC站点的“无效的JSON原语:alihac
- 为熟悉ASP.NET Web表单开发的人建议MVC3的周末学
- asp.net-mvc – KendoUI网格显示总记录数
- ASP.NET中上传并读取Excel文件数据示例
- asp.net-mvc – 如何组合两个dataTextFields的Se
- asp-classic – 哪里可以存储经典ASP的连接字符串
- asp.net – 多个用户控件和JavaScript
- asp.net-mvc – ASP.NET MVC忽略所有url结尾的“
- asp.net – 基于函数式编程的UI
热点阅读
