1

Topic: How to receive result of representation

How in the controler to receive result of representation? Here for example PartialView (model) or View (model) which marking as a result generate??? It would be desirable it is all to see not on client side (using JavaScript), and on server side that it would be possible to check up certain tags/attributes using UnitTest

2

Re: How to receive result of representation

Hello, SanyaVB, you wrote: SVB> As in the controler to receive result of representation? SVB> here for example PartialView (model) or View (model) which marking as a result generate??? It would be desirable it is all to see not on client side (using JavaScript), and on server side that it would be possible to check up certain tags/attributes using UnitTest Itself asked a question and itself I answer: private string GetHTML (ViewResultBase viewResult) {ControllerContext context = ControllerContext; viewResult. ExecuteResult (context); using (var stream = new System. IO.StringWriter ()) {var viewContext = new ViewContext (context, viewResult. View, viewResult. ViewData, new TempDataDictionary (), stream); viewResult. View. Render (viewContext, stream); return stream. GetStringBuilder ().ToString ();}}