I have the following code:
public class NavigationPath
{
private string menuItems = "<li>" +
"<a href=\"#\">home</a>" +
"</li>";
But I would like to have:
public class NavigationPath
{
private string menuItems = "<li>" +
"<a href=\"" + ResolveClientUrl("~/home.aspx") + "\">re</a>" +
"</li>";
However, I am not able to use ResolveClientUrl inside a Class. Any ideas?
Instead of calling ResolveClientUrl
on the Page object (or any controls), you can also use VirtualPathUtility.ToAbsolute("~/home.aspx");
which will give you the same result as calling ResolveUrl("~/home.aspx");