Method 1
You can read html as string by using normal File.ReadAllText Method
public static string GetHtml(string path)
{
string html = File.ReadAllText(path);
return html;
}
and then Create an ActionResult for returning the html as json string like below
[HttpGet]
public ActionResult LoadHtml(int id)
{
var html=GetHtml("you html file path");
var result = new { Value = html };
return Json(result, JsonRequestBehavior.AllowGet);
}
Call the action by using jQuery from the client and insert the html in to a container you want
jQuery(document).ready(function(){
$("#buttonClick").click(function() {
var ServiceUrl ="/YourController/LoadHtml;
var content = '';
$.support.cors = true;
$.ajax({
type: 'GET',
url: ServiceUrl,
async: true,
cache: false,
crossDomain: true,
contentType: "application/json; charset=utf-8",
dataType: 'json',
error: function (xhr, err) {
},
success: function (result, status) {
$('#yourdivId').html(result.Value);
}
});
});
});
Method2
By using Render js also you can load template in to html
for more
http://www.jsviews.com/#jsrender[
^]
Hope this helps