Reputation: 4194
I have two questions on the render order of the partial view
Upvotes: 0
Views: 218
Reputation: 10763
You can have multiple $(document).ready() calls in the same document. Each $.ready() or $.live() are rendered in the same order that they appear in the code.
In your partial view you can dynamically insert your css script to the head of the page:
<script type="text/javascript">
$(document).ready(function() {
$('<link href="' + @Url.Content("~/Content/Site.css") + '" rel="stylesheet" type="text/css" />').appendTo('head');
});
</script>
Users may notice a slight delay for these styles to take effect after the DOM has loaded.
Upvotes: 1