I had this in a .cshtml view:
<script src="/Scripts/app/[email protected]()"></script>
Razor renders this to the view:
<script src="/Scripts/app/app.min.js?41231112"></script>
When I change the .cshtml view to this:
<script src="/Scripts/app/[email protected]()"></script>
Then I get this in the rendered view:
<script src="/Scripts/app/[email protected]()"></script>
How do I get @Html.BuildTag()
to render 41231112
when there's no leading ?
character?
Make it an explicit code block by wrapping it in ()
.
<script src="/Scripts/app/app.min.js@(Html.BuildTag())"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With