admin管理员组

文章数量:1642443

Redirect、RedirectPermanent;
RedirecToAction、RedirectToActionPermanent;
RedirectToRoute、RedirectToRoutePermanent的区别:
1、
不带Permanent的是302临时跳转,搜索引擎将会收录当前地址,带Permanent的是301永久跳转,搜索引擎将会收录跳转后的地址。

Redirect、RedirectPermanent后面的参数为url,例如“home/index”

2、
RedirecToAction、RedirectToActionPermanent后面的参数为action,例如“index”,此处为当前controller下的action名称

3、
RedirectToRoute、RedirectToRoutePermanent后面的参数为action,例如new { action=“index”, controller =“home”}

本文标签: 区别ToActionpermanentredirectToRoutePermanent