rwkiii
rwkiii

Reputation: 5846

How do I convert this ASP.NET Webforms example to MVC5 razor compatible?

I have an example of how to include a resource into MVC, but it's ASP.NET Webforms. I'm not sure how to convert this to MVC razor form. I've made several attempts. Pretty sure the <%= gets replaced with @ but that's going to mess up the " groupings.

<script src="<%= Westwind.Globalization.JavaScriptResourceHandler.GetJavaScriptResourcesUrl("globalRes","CodePasteMvc.Resources.Resources")" type="text/javascript"></script>

Upvotes: 0

Views: 205

Answers (1)

Pratik Bhoir
Pratik Bhoir

Reputation: 2144

<%= gets replaced with @
and " groupings are not converted. they remains the same. Razor is smart to handle that

For more Info about converting Click Here

Your Code is already correct

<script src=" @Westwind.Globalization.JavaScriptResourceHandler.GetJavaScriptResourcesUrl("globalRes","CodePasteMvc.Resources.Resources")" type="text/javascript"></script>

Upvotes: 1

Related Questions