The issue:The menu is assigned a selected class based on the click in MVC3 . The class however was reset after the page was reloaded. Tried to solve it using jQuery cookies but the values are not assigned correctly .. (The class is assigned after 2-3 clicks on that menu and not on the first click .The menu example is as under\[code\] <div class="wrap-nav"> <div class="menu"> <ul> <li> @Html.ActionLink("Profile", "Index", "Profile") </li> <li>@Html.ActionLink("Search", "Index", "Search") </li> <li>@Html.ActionLink("Contacts", "ContactView", "Contact")</li> <li>@Html.ActionLink("Log Out", "LogOut", "Profile") </li> </ul> </div></div>\[/code\]The jquey code is as under\[code\]$(document).ready(function () { $("#Menu .wrap-nav .menu ul li a").click(function () { $.cookie("selectedMenu", $(this).text());}); $("#Menu .wrap-nav .menu ul li a").each(function () { if ($(this).text() == $.cookie("selectedMenu")) { $(this).parent().addClass("selected"); return false; } });});\[/code\]Any help will be appreciated.