ASP.Net C# ResolveClientUrl inside Class

前端 未结 4 1147
我寻月下人不归
我寻月下人不归 2021-02-01 20:36

I have the following code:

public class NavigationPath
{
    private string menuItems = \"
  • \" + \"
  • 4条回答
    •  北海茫月
      2021-02-01 21:34

      I found VirtualPathUtility.ToAbsolute to work very well for my purpose.

      Worked perfectly:

      protected void build_Menu() 
      {
      
          StringBuilder sb = new StringBuilder();
      
          sb.Append("
    • Home
    • ")); sb.Append("
    • Cars
    • ")); sb.Append("
    • Airplanes
    • ")); sb.Append("
    • Motorcycles
    • ")); sb.Append("
    • Reports
    • ")); sb.Append("
    • Manuals
    • ")); sb.Append("
    • Administration
    • ")); MENUfromCodeBehind.Text = sb.ToString(); }

    提交回复
    热议问题