I have been working in an MVC project, and have seen both of these used. I was wondering what the difference between them is? Is it incorrect to use one over the other? My understanding is that I should be using Url.Content(), but VirtualPathUtility.ToAbsolute() seems to be working as well.
+1
A:
Url.Content()
is an utility method part of MVC. Being there to uniformize and centralize utility classes I guess.
VirtualPathUtility.ToAbsolute()
is a .NET Framework method. Maybe the MVC one is using it, we would have to check the source...
Hope the helps
Mike Gleason jr Couturier
2010-08-25 15:40:54
Url.Content() eventually calls VirtualPathUtility but it does quite a bit more. I'd edit your answer but I'd need to post buckets full of code. ;)
jfar
2010-08-25 16:05:28
Thanks for clarifications jfar!
Mike Gleason jr Couturier
2010-08-25 17:38:01