How to change class active for a menu which is partial ASP.NET MVC
<p>I have a partial view which I used it for all my views as a menu </p>

<p>I import this menue above all of the views with this line code </p>

<pre><code>@Html.Partial("_MainMenu")
</code></pre>

<p>mainly i want to change <code>class:"active"</code> between views but i don't know how it is possible in this structure. </p>

<p>my problem is that I want when user opens a link in menu, first omit <code>class:"active"</code> from all of the tags and then add <code>class active</code> for that same link which user opens.
for example when user is in home-index then its tag has class active so Home text in menu has a lighter color and then when user is for example in contact_us view I want the contact us text in menu has a lighter color by giving active class.</p>

<p>Appreciate any help. thanks</p>

<p>this is my partial menu view  if needed , default is for home index</p>

<pre><code>&lt;div id="mainnav" class=""&gt;
&lt;nav class="navbar navbar-default" role="navigation"&gt;
    &lt;div id="topmenu" class="fixsaz"&gt;

    &lt;/div&gt;


    &lt;div class="row"&gt;
        &lt;div class="navbar-header col-md-4 col-sm-6"&gt;


            &lt;a class="" id="titlename" href="Home"&gt;
                &lt;img class="" src="~/Content/img/logo/iranjourney.png" alt="iranholiday.com" /&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="col-md-8 col-sm-10 collapse navbar-collapse overflowshow" id="example-navbar-collapse"&gt;

            &lt;ul id="mainul" class="nav navbar-nav  overflowshow"&gt;
                &lt;li class="active"&gt;// default is for home index 
                    @Html.ActionLink("HOME", "index", "Home")

                &lt;/li&gt;


                &lt;li class="dropdown"&gt;
                    &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;
                        OUR TOURS
                        &lt;b class="caret"&gt;&lt;/b&gt;
                    &lt;/a&gt;

                    &lt;ul class="dropdown-menu"&gt;
                        &lt;li&gt;
                            &lt;a href="#"&gt;Scheduled Group Tours&lt;/a&gt;
                        &lt;/li&gt;
                        &lt;li&gt;&lt;a href="/Tours_By_Category/index"&gt;Tours By Category&lt;/a&gt;&lt;/li&gt;


                    &lt;/ul&gt;

                &lt;/li&gt;

                &lt;li class="dropdown"&gt;
                    &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;

                        &lt;b class="caret"&gt;&lt;/b&gt;
                    &lt;/a&gt;



                &lt;/li&gt;


                &lt;li class="dropdown"&gt;
                    &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;
                        OUR SERVICES
                        &lt;b class="caret"&gt;&lt;/b&gt;
                    &lt;/a&gt;



                &lt;/li&gt;



                &lt;li class="dropdown"&gt;
                    &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;
                        ABOUT US
                        &lt;b class="caret"&gt;&lt;/b&gt;
                    &lt;/a&gt;

                    &lt;ul class="dropdown-menu"&gt;
                        &lt;li&gt;
                            &lt;a href="/Home/About_US"&gt;
                                &lt;p&gt;Team work&lt;/p&gt;
                                &lt;p&gt;Certificates&lt;/p&gt;
                                &lt;p&gt;Statistics&lt;/p&gt;
                                &lt;p&gt;Our agents&lt;/p&gt;
                            &lt;/a&gt;
                        &lt;/li&gt;


                    &lt;/ul&gt;

                &lt;/li&gt;

                &lt;li&gt;
                    @Html.ActionLink("CONTACT US", "index", "Contact_US")


                &lt;/li&gt;

            &lt;/ul&gt;

        &lt;/div&gt;
    &lt;/div&gt;





&lt;/nav&gt;
</code></pre>

<p></p>