below is code snippet which return view to jquery function but i like to know how could i extract or get the view html and return to client end.
$(function(
What I understand is you need a way to return raw HTML of your view to client side. If that's what you want you have to use the ViewEngine that MVC uses to render HTML.
Below is the sample :
using (StringWriter sw = new StringWriter())
{
ViewEngineResult viewResult = null;
viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName);
var viewContext = new ViewContext(ControllerContext, viewResult.View, ViewData, TempData, sw);
viewResult.View.Render(viewContext, sw);
return sw.GetStringBuilder().ToString();
}
Above code finds a partial view and converts it into HTML String by MVC view engine.
Hope this helps.