asp.net-mvc – 已经使用相同的参数类型定义了一个名为“Create”的成员
发布时间:2021-03-31 04:31:25 所属栏目: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 自动将汉字转换成拼音第一个字母
- kendo-ui – 剑道网格刷新(数据绑定两次)
- 我应该在ASP.NET MVC中构建我的下一个Web应用程序吗?
- 是否可以使用ASP.NET ScriptManager来使用Windows FIPS安全
- asp.net – 如何扩展aspnet成员身份验证表?
- 在asp.net中使用eval(“”)
- asp.net-mvc – View中的意外NullReferenceException
- Asp.net MVC实现生成Excel并下载功能
- asp.net – 如何查看Chrome开发者工具中发布到表单的数据大
- 从ASP.NET MVC应用程序中的Amazon SES发送电子邮件
推荐文章
站长推荐
- asp.net – OutOfMemoryException当发送大文件50
- asp.net-mvc – 使用Entity FrameWork保存更改/更
- IIS ASP.NET WebApi在请求同一台服务器时死锁
- asp.net Gridview,1记录跨度两行
- asp.net – Orchard CMS Media中的文件大小上传限
- .net – 什么可以解释托管堆上超过5,000,000个Sy
- ASP.NET 2.0和4.0似乎在Forms身份验证中以不同方
- ASP.NET通过分布式Session提升性能
- asp.net-mvc – LabelFor和TextBoxFor不生成相同
- ASP.NET网站管理系统退出 清除浏览器缓存,Sessio
热点阅读