使用 AngularJS ui-router 在 html 页面内加载 cshtml 视图
Load cshtml view inside html page using AngularJS ui-router
我之前使用 ui-router 在一个 html 页面中加载多个 html 页面,现在我想在其中加载我的 cshtml 视图html 页,不会使用 iframe。
因为我找不到任何合适的教程,所以我不知道这是怎么可能的。
任何帮助将不胜感激。
看看这个 link here:
This article explains how to render a partial view and JSON data using AJAX. I have divided this article into three sections to
understand both concepts, the first section describes the basic code
and structure that is common in both concepts, the second section
describes how to render a partial view using AJAX and the last section
describes how to render JSON data on a web using AJAX.
这讨论了如何从 ajax 调用中获取视图的 HTML,然后您可以用它做任何您需要的事情。
使用 ng-include
有什么问题?只需为您的视图添加 MVC 路由并使用 ng-include="'/my-route/'"
.
我之前使用 ui-router 在一个 html 页面中加载多个 html 页面,现在我想在其中加载我的 cshtml 视图html 页,不会使用 iframe。 因为我找不到任何合适的教程,所以我不知道这是怎么可能的。 任何帮助将不胜感激。
看看这个 link here:
This article explains how to render a partial view and JSON data using AJAX. I have divided this article into three sections to understand both concepts, the first section describes the basic code and structure that is common in both concepts, the second section describes how to render a partial view using AJAX and the last section describes how to render JSON data on a web using AJAX.
这讨论了如何从 ajax 调用中获取视图的 HTML,然后您可以用它做任何您需要的事情。
使用 ng-include
有什么问题?只需为您的视图添加 MVC 路由并使用 ng-include="'/my-route/'"
.