ASPX页面的Response.Redirect到MVC视图 [英] ASPX Page Response.Redirect to MVC View

查看:338
本文介绍了ASPX页面的Response.Redirect到MVC视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在ASPX返回从MVC以便Response.Redirect的?

Is it possible to Response.Redirect in aspx that returns a view from MVC?

我有我需要在登录成功重定向到〜/查看/主页/ index.cshtml一个看法是这样的一种可能的页面的Login.aspx?我试着以下,但想不出URL来解决。

I have an login.aspx page that i need upon successful login to redirect to a view in ~/Views/Home/index.cshtml is this possible? I've tried to following but the url couldnt be resolved.

尝试:


  1. 的Response.Redirect(〜/查看/主页/ Index.cshtml);

的Response.Redirect(家);

该控制器的HomeController和看法是Index.cshtml与如何调用一个控制器和视图或至少只是URL将帮助任何帮助。

The controller is "HomeController" and the view is "Index.cshtml" any help with how to call a controller and view or atleast just the url would help.

推荐答案

如何的Response.Redirect(/首页/索引); - 那是当然的$你是p $ psuming一个的HomeController 与返回你正在寻找的视图(按约定的首页行动这将是具有相同的名称作为行动的看法,除非另行指定)。

How about Response.Redirect("/Home/Index"); - that is of course presuming that you have a HomeController with an Index action that returns the view you're looking for (by convention it's going to be a view having the same name as the action, unless you specify otherwise).

这篇关于ASPX页面的Response.Redirect到MVC视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆