Bundles.RenderScripts() returns hash value instead of scripts

45 views
Skip to first unread message

Raphael Burnes

unread,
Feb 16, 2016, 5:53:53 PM2/16/16
to Cassette
Hi there,

First thank you for creating Cassette - I'm excited to get it running in production.

I'musing Cassette on a Commerce Server website running asp.net 3.5 and I've found a peculiarity that has left me scratching my head...

When using our template / primary layout file - StandardLayout.master - I can use <%=Bundles.RenderScripts() %> just fine and the output will be correct - e.g. "<script src="/cassette.axd/asset/includes/js/sitewide/..."

However, on a plain aspx file that is not using a backing template, (we have a few standalone pages) when I use "<%= Bundles.RenderScripts() %>", I get this kind of output instead: "f3307415-9593-48ca-95ed-4c7557106764"

It doesn't seem to help to add ->ToHtmlString() or ToString() on it. My guess is this is an object reference to something I don't mean to be using, but I'm not sure of the best way to investigate or resolve the issue.

I am new to asp.net (coming from mostly python/django) so it's very possible it's just some obvious thing I am missing.

Thank you for any help or direction you may be able to point me in,
Raphael

Raphael Burnes

unread,
Feb 16, 2016, 6:28:39 PM2/16/16
to Cassette
I'll also note I've found a few discussions around a similar thing and it seems to be the consensus is to add rewriteHtml="false" in web.config, per these discussions:

However, this breaks my pages that use StandardLayout.master, by preventing me from calling Bundles.Reference() in template files. 

Would it be possible to add a call time option to just get direct <scripts> or <links> bundle string instead of grabbing the token?
Functionally this would enable me to toggle rewriteHtml flag in web.config on a per usage basis - when calling Bundles.RenderX()

Thoughts?

Thank you,
Raphael
Reply all
Reply to author
Forward
0 new messages