net MVC 重定向总结
[HttpPost]
public ActionResult StudentList(string StudName, string studName, DateTime BirthDay, FormCollection form, string controller, string Action, StudentModels student)
{ //其中StudName为aspx页面中标签的name属性(StudName不区分大小写)
//其中BirthDay为页面中标签的name属性(类型可自己指定【需转换成功才可以】,这里为DateTime)同样BirthDay不区分大小写
//其中controller,Action为路由信息(controller,Action不区分大小写)
//FormCollection包含了post回来的信息 通过form[]来取值
//如果使用强类型绑定 可通过实体回传值 这里实体为StudentModels
//同样可以使用Request.Form[] Request.QueryString[] Request[] 来取值 不过此Request非WebForm中的Request 这里的Request是RequestBase抽象类的实例 WebForm中Request是封装类 HttpRequest的实例 #region 到要经过执行controller里方法后 显示出页面。
return RedirectToAction("Index");//可跳出本controller
return RedirectToRoute(new {controller="Home",action="Index"});//可跳出本controller
Response.Redirect("Index");//只能使用本controller下的方法名称。返回值为void
return Redirect("Index");//只能使用本controller下的方法名称。
#endregion #region 直接显示出对应的页面 不经过执行controller的方法。
return View("Index");//非本方法
return View("~/Views/Home/Index.aspx");//这种方法是写全路径
#endregion
return View();
}
net MVC 重定向总结的更多相关文章
- spring mvc重定向
spring mvc重定向有三种方法. 1.return new ModelAndView("redirect:/toUrl"); 其中/toUrlt是你要重定向的url. 2.r ...
- Spring MVC重定向和转发以及异常处理
SpringMVC核心技术---转发和重定向 当处理器对请求处理完毕后,向其他资源进行跳转时,有两种跳转方式:请求转发与重定向.而根据要跳转的资源类型,又可分为两类:跳转到页面与跳转到其他处理器.对于 ...
- spring mvc重定向方法
一.不带参数,直接重定向到另一个地址: 返回String直接跳转,如: @RequestMapping(value = "/filehandle") public String u ...
- Spring MVC重定向和转发及异常处理
SpringMVC核心技术---转发和重定向 当处理器对请求处理完毕后,向其他资源进行跳转时,有两种跳转方式:请求转发与重定向.而根据要跳转的资源类型,又可分为两类:跳转到页面与跳转到其他处理器.对于 ...
- spring mvc 重定向加传参
常用: ModelAndViewi: return new ModelAndView("redirect:/toList"); 或者 ii:return "redire ...
- Spirng MVC 重定向传递对象
在 Spring MVC 中我们会经常遇到重定向. @RequestMapping("/order/saveorder.html") public String saveOrder ...
- mvc 重定向的几种方式
在RouteConfig添加一个简单的路由 //新增路由 routes.MapRoute( name: "Article", url: "Detial/{id}" ...
- spring mvc 重定向问题
(1)我在后台一个controller跳转到另一个controller,为什么有这种需求呢,是这样的.我有一个列表页面,然后我会进行新增操作,新增在后台完成之后我要跳转到列表页面,不需要传递参数,列表 ...
- spring mvc重定向页面
@RequestMapping(value="/del/{id}") public String delUser(@PathVariable int id){ return &qu ...
- Spring MVC重定向和转发
技术交流群:233513714 转发和重定向 开始Java EE时,可能会对转发(forward)和重定向(redirect)这个两个概念不清楚.本文先通过代码实例和运行结果图片感性 认识二者的区别, ...
随机推荐
- SharePoint 2013 User Profile Services之跨场发布
在之前博客中已经描述了User Profile的两种配置场景,这篇博客将详细介绍微软官方推荐的配置方法. 测试环境的架构可以参考之前的博客内容,这里就不做介绍了,直接切入主题. 1. 在sp-farm ...
- QuickFlow UI 控件之 NamedFormAttachment
在开发自定义表单时,如果碰到需要按类别上传附件的情况,(比如流程附件分为草稿版,正式版,发布版),比较难处理,需要开发自定义字段控件来实现. QF最新版本(Build131124)提供了NamedFo ...
- iOS UIMenuController菜单
//1:普通 //// ViewController.m// DemoTest#import "ViewController.h"@interface ViewControll ...
- Intent的七大组件——Android开发之路5
------Intent------ Android中三个核心组件——Activity.Services.BroadCastProvider都是通过Intent传递参数. startActivity( ...
- Eclipse部署项目的原理简介eclipse,wtpwebapps,tomcat
转载请注明出处! http://www.cnblogs.com/libingbin/ 感谢您的阅读.如果文章对您有用,那么请轻轻点个赞,以资鼓励.
- 使用logminer挖掘日志,分析历史操作 系列一
===============STARTED==================================== 事件起因: 业务的人mail过来说是有张表记录的10K+的优惠码记录没了,要我们确 ...
- .replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app
提示错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arg ...
- log4j2 不使用配置文件,动态生成logger对象
大家平时使用Log4j一般都是在classpath下放置一个log4j的配置文件,比如log4j.xml,里面配置好Appenders和Loggers,但是前一阵想做某需求的时候,想要的效果是每一个任 ...
- C#基础-事件 继承类无法直接引发基类的事件
An event can be raised only from the declaration space in which it is declared. Therefore, a class c ...
- [WPF系列] 高级 调试
调试工具 ImageBrush出现TypeConverter问题 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExt ...