asp.net-mvc – 已经使用相同的参数类型定义了一个名为“Create”的成员
发布时间:2021-03-30 23:37:43 所属栏目: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 – 获取ControllerName和ActionName并在Master
- asp.net core webapi 服务端配置跨域的实例
- asp.net – Tridion分析和个性化错误:用户不能为空.请确保
- ASP.NET web.config中数据库连接字符串connectionStrings节
- asp.net – 部分视图呈现按钮点击
- asp.net全局资源错误’找不到具有键”的资源对象’
- LoginView中的ASP.NET LoginStatus不会触发LoggingOut事件
- asp.net – IE8 Win7 Facebook Connect问题
- asp.net-core – 如何在Visual Studio 2015 RC中为ASP.NET
- asp.net-mvc – 在没有模型的情况下手动将验证添加到文本框
推荐文章
站长推荐
- asp.net-mvc – asp.net mvc – string或int的路
- 在asp.net c#应用程序中使用Graphviz Dll
- asp.net-mvc – 在ASP.NET MVC 2中模板化Html.Di
- asp.net-mvc-3 – 如何将复选框绑定到mvc3中的vi
- asp.net-mvc-4 – ASP.NET MVC 4通过ActionLink传
- 在asp.net中读取查询字符串而不指定任何页面名称
- asp.net-mvc – 根据浏览器接受语言自动设置uiCu
- asp.net-mvc-2 – 使用’class(或其他保留关键字
- 模型绑定 – WebApi2:自定义参数绑定以绑定部分
- asp.net使用AJAX实现无刷新分页
热点阅读