asp.net-mvc – 已经使用相同的参数类型定义了一个名为“Create”的成员
发布时间:2021-03-31 05:31:56 所属栏目: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 } } (编辑:驻马店站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 实体框架 – 使用EF和WebAPI,如何返回一个ViewModel并支持I
- asp.net-mvc – 使用AD的ASP.NET MVC表单Auth在本地工作但在
- asp.net-mvc – MVC导航到不同的控制器视图
- 所有我使用IO的动作都是异步的?
- asp.net – 通过邮件发送wcf服务消费表单数据
- 是否可以使用ASP.NET ScriptManager来使用Windows FIPS安全
- 为什么asp.net会员资格有用户表和会员表?
- asp.net-mvc – asp.net MVC antiorgerytoken异常RedirectT
- asp.net-mvc-3 – 如何从ASP.NET MVC#输出中删除空格?
- asp.net – 如何MSDeploy构建的网站包到一个处女IIS网站
推荐文章
站长推荐
- asp.net – 应用程序池循环如何影响ASP Net会话状
- asp.net-mvc – DDD原理和ASP.NET MVC项目设计
- 对asp.net网站进行基准测试,我可以使用jmeter吗?
- asp.net代码中修改web.config节点的具体方法
- 从app_data中删除文件夹时如何防止asp.net重新编
- asp.net – 菜单控件生成的js导致Web窗体中的Sys
- ASP.NET MVC删除操作方法中的查询字符串
- asp.net-web-api – 首先使用ASP.NET Web API的E
- asp.net – App Settings和connectionStrings配置
- asp.net-mvc-3 – MVC3正确的方式来改变每个请求
热点阅读