I am programming for the first time in ASP.NET. It turned out to be very easy, and I really enjoy it. One of the features that I like is that on the webpage I can link to files from root using the tilde character (~) and then the rest of the path. However, this does not seem consistent. For example, it works in the href context, for example.
<link href="~/css/StyleSheet.css" />
This does not work with respect to src, for example.
<img src="~/images/header.jpg" />
Why is this? I'm doing something wrong. The mismatch is annoying.
source share