View Single Post
  #7 (permalink)  
Old March 27th, 2008, 11:42 AM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

As Doug suggests, you need to be careful where you try to use the ~ character.

Many server controls will process that character appropriately. But when you need to use a app root relative path in a non server control you can still process it manually. For example:

string correctUrl;
correctUrl = ResolveUrl("~/images/someimage.jpg");

You can now use that resolved url in plain HTML or in a control that may not process the ~ itself.

-Peter
peterlanoie.blog
Reply With Quote