Monday, April 12, 2010

Resolving MVC Paths Problem

Target: ASP.NET MVC
If you are using MVC approach while using ASP.NET you might notice the problem of relative paths specially if you use
JQuery with it.

This issue can be solved using Url.Content method which converts relative path to absolute path
I hope it helps


<%= Url.Content("~/content/...") ... %>

1 comment:

  1. example:
    src="<%= Url.Content("~/Content/jquery-1.2.6.min.js") %>"

    ReplyDelete