using squishit and rendering external minifiedjs at the end of body element

494 views Asked by At

I have master page and child page in my aplication. At runtime i determine the js & css to be included in master page pre-init method and render the js & css using squish it (bundlecss.AsCached & bundlecss.Render) method. In master page Head control the file is included using Bundle.Css().RenderNamed method.

Now my requirement is to include the external js file at the end of body element to enable faster rendering of web page. When i called Bundle.Css().RenderNamed at the end of the body element, the js file is not included in the page.

Is it not possible to specify the location where the minified js should be included in page html when using squish framework ?

Thanks in advance. Brahmaiah

1

There are 1 answers

0
AlexCuse On

You probably don't want to do things this way. The cached/named bundles are for scenarios where you can't (or don't want to) create physical files. The way you're doing it here just creates more complexity. Bundle.JavaScript().Add("~/file.js").Render("~/blah") will still cache the bundle, but it uses the file on disk (only created once).

Are you really calling Bundle.Css().RenderNamed("javascript bundle name")? If so you need to change the call to Bundle.JavaScript().RenderNamed. If this is just a typo it would help to see more code / markup.