I came across an issue when I was testing my HTML Helper. Basically I'm creating a grid with loads of rows, columns and different types of data in it. In the header there is also a image to notify the user what column the data is sorted by. However, when I'm writing my test now (way too late, but better late than never right?!), I get this error thrown:
"The application relative virtual path '~/Images/SortingArrowUp.png' cannot be made absolute, because the path to the application is not known."
var imgPath = VirtualPathUtility.ToAbsolute("~/Images/SortingArrowUp.png");
How can I solve this. I can understand how this might be an issue during the test, and the image might not be available and all that, but what's the correct way to do this then?