简体   繁体   English

如何从Asp.net普通页面调用Asp.net MVC页面?

[英]How to call Asp.net MVC page from Asp.net normal page?

I have Asp.net application. 我有Asp.net应用程序。 I want to integrate another Asp.net MVC application to exsting Asp.net application. 我想将另一个Asp.net MVC应用程序集成到现有的Asp.net应用程序中。

So I did the following changes. 因此,我进行了以下更改。

1.I added area in exsting Asp.net application. 1.我在现有的Asp.net应用程序中添加了区域。 2.Added path in routeconfig. 2.在routeconfig中添加了路径。 3.Now How to call Asp.net MVC Razor ?? 3.现在如何调用Asp.net MVC Razor ??

Controller Name-Home Action Name-Home 控制器名称-主页操作名称-主页

How to call Home page inside MVC Area from js file present in asp.net project. 如何从asp.net项目中存在的js文件在MVC区域内调用主页。

Thanks in advance ! 提前致谢 !

it's same as calling other page.. just you set up the proper routing structure in order to render the view. 它与调用其他页面相同。只是您设置了正确的路由结构以呈现视图。

document.location.href='yourArea/FolderName/Home/Action';

or you can use an HyperLink to achieve the same 或者您可以使用HyperLink实现相同

<a href="yourURlTOMvcView">MVC view </a>

如果只想调用方法,则简单的方法是Response.Redirect(“〜/ ControllerName / ActionMethodName”);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM