Skip to content

Instantly share code, notes, and snippets.

@GuyHarwood
Created February 12, 2013 16:47
Show Gist options
  • Save GuyHarwood/4771250 to your computer and use it in GitHub Desktop.
Save GuyHarwood/4771250 to your computer and use it in GitHub Desktop.
When using Bootstrap tabs in ASP.Net MVC, this allows you to find the anchor tag with the href that matches the current page via Request.RawUrl
$('a[href$="@Request.RawUrl.Replace("/",@"\/")"]').parent().addClass('active');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment