You can check the URL and based on that select the Menu link
<li class='<%=Request.Url.AbsolutePath.ToLower().Contains("home") ? "active" : "" %>'>Home</li>
<li class='<%=Request.Url.AbsolutePath.ToLower().Contains("contact") ? "active" : "" %>'>Contact</li>