Thursday, October 15, 2009

MVC Custom Route Problem on Scripts Path

If you encountered this error on your scripts
"A public action method 'Scripts' could not be found on controller"

It means that there is a problem mapping this files.

Since Custom routes changes the Path/Url, your views needs to be aware of this.

To avoid this problem you need to change the script url to this:
<script src="%3C%=%20Url.Content%28">" type="text/javascript"></script>
<script src="%3C%=%20Url.Content%28">" type="text/javascript"></script>
<script src="%3C%=%20Url.Content%28">" type="text/javascript"></script>

It will generate the correct path of your scrips

No comments:

Post a Comment