This worked for me:
<li id="test1" style="font-family:Merriweather;" runat="server"><a href="advertize.aspx">Advertise</a></li>
<li id="test2" class="dropdown" style="font-family:Merriweather;" runat="server">
<a href="exhibition.aspx" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Exhibitions <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li style="font-family:Merriweather;"><a href="dubaiexhibitions.aspx">Trade fairs in U.A.E</a></li>
<li style="font-family:Merriweather;"><a href="exhibition.aspx">Trade fairs worldwide</a></li>
<li style="font-family:Merriweather;"><a href="addexhibition.aspx">Add Your Event</a></li>
</ul>
</li>
<li id="test3" style="font-family:Merriweather;" runat="server"><a href="subscribe.aspx">Subscribe</a></li>
<li id="test4" style="font-family:Merriweather;" runat="server"><a href="member_benefits.aspx">Memberships</a></li>
<li id="test5" style="font-family:Merriweather;" runat="server"><a href="aboutus.aspx">About us</a></li>
<li id="test6" style="font-family:Merriweather;" runat="server"><a href="news.aspx">News</a></li>
<li id="test7" style="font-family:Merriweather;" runat="server"><a href="contactus.aspx">Contact us</a></li>
<li id="test8" style="font-family:Merriweather;" runat="server"><a href="media_partners.aspx">Partners</a></li>
<li id="test9" style="font-family:Merriweather;" runat="server"><a href="login.aspx" runat="server"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
C# code :
Page Load
{
String activepage = Request.RawUrl;
if (activepage.Contains("advertize.aspx"))
{
test1.Attributes.Add("class", "active");
}
else if (activepage.Contains("subscribe.aspx"))
{
test3.Attributes.Add("class", "active");
}
else if (activepage.Contains("member_benefits.aspx"))
{
test4.Attributes.Add("class", "active");
}
else if (activepage.Contains("aboutus.aspx"))
{
test5.Attributes.Add("class", "active");
}
else if (activepage.Contains("news.aspx"))
{
test6.Attributes.Add("class", "active");
}
else if (activepage.Contains("contactus.aspx"))
{
test7.Attributes.Add("class", "active");
}
else if (activepage.Contains("media_partners.aspx"))
{
test8.Attributes.Add("class", "active");
}
else if (activepage.Contains("login.aspx"))
{
test9.Attributes.Add("class", "active");
}
}