如何从asp.net MVC应用程序重定向到特定的角度页面

时间:2019-05-28 16:44:25

标签: angular angular2-routing

我有一个asp.net MVC应用程序,它的页面之一有一个Button /超链接,可以在MVC应用程序中打开angular2页面/组件。部署的angular服务器上有类似app / myproject-ui的文件夹。在MVC应用程序中,我已经定义了有角度的PATH / URL,例如:

<add key="MyAngularURL" value="https://servername/app/myproject-ui/" />

并且在Angular app.module中定义了空路径。

      const appRoutes: Routes = [
      {
       path: '',
       component: ViewSummaryComponent
      },
      {
       path: 'admin/addnewXYZ',
       component: addnewXYZComponent
      },

因此,来自MVC的aboveURL确实启动了有角度的应用程序,默认页面-ViewSummaryComponent,但是我的问题是如何给MVC提供“ addnewXYZComponent”的路径,因为没有像app / myproject-ui / admin / addnewXYZ这样的路径。 ...在服务器上。

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以在控制器中使用它

return Redirect(stringFullUrl);