How do you resolve a url like "../../images/test.png" to "http://yoursite.com/images/test.png" in a static asp.net web method?
+1
A:
Here is a blog entry from Rick Strahl that might help: http://www.west-wind.com/weblog/posts/154812.aspx
Daniel Dyson
2010-06-23 11:46:59
jip, that is a really good article, but if I understand the code correctly it would not work for situations where your have ../../../ etc in the url. but I could be wrong
Daniel Brink
2010-06-23 11:54:19
Is the images folder in the root directory? If so, replace ../../ with ~/ That is what the resolver is supposed to do, change ~/ to the appropriate path, depending on the nesting level of the page.
Daniel Dyson
2010-06-23 12:00:30
i cannot replace ../../ with ~/ as any number of ../ relative paths to various pages and files can be passed to my static webmethod. i therefore need a way to convert a relative path such as ../1/2/3/4/page.aspx to http ://abc.com/a/b/s/1/2/3/4/page.aspx
Daniel Brink
2010-06-23 12:07:40
Ok, I think you need to provide more examples of what you need to do in your question
Daniel Dyson
2010-06-23 12:21:08