title: mvc page navigation. How I solve this?
body: <p>I used below code in ASp.NET web forms code behined. Its passing parameter in the URL to which which page I am on so that I make HTML and add ON CLASS to show the page I am on. Now</p>
  
  <p>How I solve this in MVC?. Any clean approach.</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
          {
              if (!(Page.IsPostBack))
              {
                  string Load;
                  Load = "";
                  string pagename = Request.Path.Substring(Request.Path.LastIndexOf("http://www.example.com/") + 2);
                  if (!(Request.QueryString["Nav"] == null))
                  {
                      if (Request.QueryString.Get("Nav") == "Home")
                      {
                          Load = "&lt;div class='menu-image'&gt;&lt;img src='images/on-left.gif' alt='' /&gt;&lt;/div&gt;&lt;div class='on'&gt;&lt;a href='default.aspx?Nav=Home' class='over'&gt;Home&lt;/a&gt;&lt;/div&gt;&lt;div class='menu-image'&gt;&lt;img src='images/on-right.gif' alt='' /&gt;&lt;/div&gt;";
                          Navigate.InnerHtml = Load + "&lt;a href='aboutus.aspx?Nav=About'&gt;About Us&lt;/a&gt;&lt;a href='contactus.aspx?Nav=Contact'&gt;Contact Us&lt;/a&gt;";
                      }
                      else if (Request.QueryString.Get("Nav") == "About")
                      {
                          Load = "&lt;div class='menu-image'&gt;&lt;img src='images/on-left.gif' alt='' /&gt;&lt;/div&gt;&lt;div class='on'&gt;&lt;a href='aboutus.aspx?Nav=About' class='over'&gt;About Us&lt;/a&gt;&lt;/div&gt;&lt;div class='menu-image'&gt;&lt;img src='images/on-right.gif' alt='' /&gt;&lt;/div&gt;";
                          Navigate.InnerHtml = "&lt;a href='default.aspx?Nav=Home' &gt;Home&lt;/a&gt;" + Load + "&lt;a href='contactus.aspx?Nav=Contact'&gt;Contact Us&lt;/a&gt;";
                      }
                      else if (Request.QueryString.Get("Nav") == "Contact")
                      {
                          Load = "&lt;div class='menu-image'&gt;&lt;img src='images/on-left.gif' alt='' /&gt;&lt;/div&gt;&lt;div class='on'&gt;&lt;a href='contactus.aspx?Nav=Contact' class='over'&gt;Contact Us&lt;/a&gt;&lt;/div&gt;&lt;div class='menu-image'&gt;&lt;img src='images/on-right.gif' alt='' /&gt;&lt;/div&gt;";
                          Navigate.InnerHtml = "&lt;a href='default.aspx?Nav=Home' &gt;Home&lt;/a&gt;&lt;a href='aboutus.aspx?Nav=About' &gt;About Us&lt;/a&gt;" + Load;
                      }
                  }
                  else if (pagename == "default.aspx")
                  {
                      Load = "&lt;div class='menu-image'&gt;&lt;img src='images/on-left.gif' alt='' /&gt;&lt;/div&gt;&lt;div class='on'&gt;&lt;a href='default.aspx?Nav=Home' class='over'&gt;Home&lt;/a&gt;&lt;/div&gt;&lt;div class='menu-image'&gt;&lt;img src='images/on-right.gif' alt='' /&gt;&lt;/div&gt;";
                      Navigate.InnerHtml = Load + "&lt;a href='aboutus.aspx?Nav=About'&gt;About Us&lt;/a&gt;&lt;a href='contactus.aspx?Nav=Contact'&gt;Contact Us&lt;/a&gt;";
                  }
                  else
                  {
                      Navigate.InnerHtml = "&lt;a href='default.aspx?Nav=Home'&gt;Home&lt;/a&gt;&lt;a href='aboutus.aspx?Nav=About'&gt;About Us&lt;/a&gt;&lt;a href='contactus.aspx?Nav=Contact'&gt;Contact Us&lt;/a&gt;";
                  }
              }
          }
  </code></pre>