views:

33

answers:

1

Hi All,

I have a application which has very bulky page and i can not reduce the functionality any more. Because of this my every page is taking too much time to load completely.

Is there any way to load the page in sequential manner. Link once i hit the URL few content get displayed immediately and other contents will get displayed one by one?

I our website we are using the Entity framework and RJSResult to render the contents.

Thanks and Regards, Kamal Kant Pansari

+2  A: 

You might use AJAX to delay loading of some page parts. Html.RenderPartial method doesn't help in this case because partial views will be rendered before sending result page to a client.

With jQuery you could do something like this:

<script src="<%= Url.Content("~/Scripts/jquery-1.3.2.js") %>" 
<script type="text/javascript">

  $(document).ready(function()
  {
    var url = '<%= Url.Action("ReturnDelayedPartialView") %>';

    // show a placeholder image 
    $("#delayed").html("<img src='<%= Url.Content("~/Content/ajax-loader.gif") %>' />");

    // load content
    $("#delayed").load(url);
  }

</script>

<div id="delayed">
</div>
Alexander Prokofyev