Use dynamic path in bundling

54 views
Skip to first unread message

Amit Pandey

unread,
Jun 17, 2020, 8:10:14 AM6/17/20
to SquishIt
Hi, 
Is there any way to include dynamic path in css and js bundling path creation.

What we can do?

<%= Bundle.Css()
       
.Add("~/css/text.css")
       
.Render("~/css/combined_#.css")
%>



What we expected?

<%= Bundle.Css()
       
.Add("<%# HttpContext.Current.Application["SITE_URL_PATH"]%>/css/text.css")
        .Render("~/css/combined_#.css")

%>



What we currently getting...
Format exception.

How can I provide dynamic url path in bundling?

Thanks,
Amit


Amit Pandey

unread,
Jun 17, 2020, 8:17:16 AM6/17/20
to SquishIt
Currently, I am using SquishIt.Framework (vs1.0.4 NuGet package) in Asp.Net web-forms.
Thanks. 

Alex Ullrich

unread,
Jun 18, 2020, 9:03:31 AM6/18/20
to SquishIt
I'm not sure I understand what you are trying to do here.  You are just trying to run the first code example right?  I would expect that to work fine as long as the needed files/folders exist.

Can you post the full exception details?

Thanks,

Alex
Reply all
Reply to author
Forward
0 new messages