StringBuilder returing Web script

Posted on


Task : With the page_type and currentpage param I made this code that returns the web script of the web page with active class on the current page through aspx behind code.

Is there a better and a shorter way of code that works just like the code below? (The difference is the else if(page_type == sales) script.append part)

protected string MakeBottomMenu(string page_type)
StringBuilder script = new StringBuilder();
string currentPage = System.IO.Path.GetFileName(Request.Url.AbsolutePath);

if (page_type == "office")
script.Append($"<li class="active"">



a href=""commute_gps.aspx?page_type={page_type}"" class=""home"">


span class=""blind"">


Leave a Reply

Your email address will not be published. Required fields are marked *