Shadi Mahmoodian
Shadi Mahmoodian

Reputation: 94

Load cshtml view inside html page using AngularJS ui-router

I've used ui-router to load multiple html pages inside one html page before, now I want to load my cshtml view inside the html page and wouldn't use iframe. as I couldn't find any proper tutorial, I don't have a clue how it is possible. any help would be much appreciated.

Upvotes: 0

Views: 773

Answers (2)

Dave
Dave

Reputation: 945

What's wrong with using ng-include? Just add an MVC route for your view and use ng-include="'/my-route/'".

Upvotes: 1

Pseudonym
Pseudonym

Reputation: 2072

Check out this 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.

This talks about how to get the HTML for a view from an ajax call and then you can do whatever you need to with it.

Upvotes: 0

Related Questions