ASP.NET MVC中的页面跳转

    技术2022-05-19  26

    1.使用传统的Response.Redirect例如string url = "/account/create";Response.Redirect(url);2.使用MVC新的RedirectToAction("Action name","Controller name");return RedirectToAction("Index","Home");//跳转到首页。第一个参数是action 的名字,第二个参数是控制器controller的名字,方法返回的是个ActionResult.也就是返回视图。


    最新回复(0)