0

I have some partial views that are rendered sequentially. I would like to create a log of what has rendered successfully on the top of the page, when the last partial view has completed. The only way I can think of, is to keep an array of log details and then display the log detail in a partial view on the top of the page, using a rendersection.

This to me seems cumbersome, I would prefer to be able to use HttpResponse.Write to display it to the page. However this way I don't seem to be able to control the ordering of where my log will appear on the screen. I would like them to be displayed in the same location on the page. Is there a more elegant solution?

gdoron
  • 147,333
  • 58
  • 291
  • 367
River
  • 1,487
  • 3
  • 15
  • 25

1 Answers1

0

Why not put div in the top of the page and every Partial View write to that div?

<div id=log > <label id="logs"> The Log: </label> </div>     

$('#logs').after('what you want1'); // from partial 1
$('#logs').after('what you want2'); // from partial 2
$('#logs').after('what you want3'); // from partial 3
$('#logs').after('what you want4'); // from partial 4

Pass the partial view the data you want to "log" in the Model\ ViewBag and start logging!

gdoron
  • 147,333
  • 58
  • 291
  • 367
  • thanks for encouraging a bit of outside the box thinking. For now, I am trying to keep this on the server side, looking at @RenderSection to see if that might work – River Nov 30 '11 at 18:22