In my PartialView I can drag and drop from my Content folder and get picture address automatic.
<div style="text-align:center">
<img src="~/Content/information-button16.png"/>
</div>
That Path render as <img src="/MyProject/Content/information-button16.png"/>
Now Im trying to create a block message and want add a waiting cursor but this doesnt seem to work, because the same code generate a different Path .
$('#tabs').block({
message: '<h1><img src="~/Content/busy.gif") /> Just a moment...</h1>'
});
The render URL is http://Myserver/MyProject/~/Content/busy.gif
After ask yesterday about it. I could fix it,
message: '<h1><img src="/MyProject/Content/busy.gif") /> Just a moment...
But know is a bad idea hard code the project path in case this change.
So what is the correct way to reference the MVC path in javascript?