我有以下代码:
public class NavigationPath
{
private string menuItems = "<li>" +
"<a href=\"#\">home</a>" +
"</li>";
但我想拥有:
public class NavigationPath
{
private string menuItems = "<li>" +
"<a href=\"" + ResolveClientUrl("~/home.aspx") + "\">re</a>" +
"</li>";
但是,我无法在类中使用 ResolveClientUrl。有任何想法吗?