Use this code:
<script id="myTmpl" type="text/html">
<div>
<img src="../Images/myPic.png">
</div>
</script>
سؤال
I have a jquery template and an image inside it like this:
<script id="myTmpl" type="text/html">
<div>
<img src="~/Images/myPic.png">
</div>
</script>
I got this error:
GET http://localhost:58864/Test/~/Images/myPic.png 404 (Not Found)
Why does it think my controller (named Test) is the root?
I have no problem placing the image outside the template.
المحلول
Use this code:
<script id="myTmpl" type="text/html">
<div>
<img src="../Images/myPic.png">
</div>
</script>