ResolveURL not resolving in a user control
Posted
by WebJunk
on Stack Overflow
See other posts from Stack Overflow
or by WebJunk
Published on 2010-03-31T15:19:59Z
Indexed on
2010/03/31
15:23 UTC
Read the original article
Hit count: 366
I'm trying to use ResolveUrl() to set some paths in the code behind of a custom ASP.NET user control. The user control contains a navigation menu. I'm loading it on a page that's loading a master page.
When I call ResolveUrl("~") in my user control it returns "~" instead of the root of the site. When I call it in a page I get the root path as expected. I've stepped through with the debugger and confirmed, ResolveUrl("~") returns "~" in my user control code behind.
Is there some other way I should be calling the function in my user control code behind to get the root path of the site?
© Stack Overflow or respective owner