Reputation: 51
My Code:
<script type="text/javascript">
var root = @Url.Content("~/Content/");
</script>
This has no effect.
<script type="text/javascript">
var root = '@Url.Content("~/Content/WebApp/img/")';
</script>
Solution.
Upvotes: 1
Views: 1917
Reputation: 79033
The first code sample is missing a pair of single or double quotes. The second one is ok. It works for me.
Or what do you mean by "This has no effect."? Have you looked at the generated HTML code? What do you get?
Upvotes: 2