I have a view with the two HtmlHelpers that produce links, something like this
<li><%:Html.ActionLink("Link A", "Index", "HomeController")%></li>
<li><%:Html.ActionLink("Link B", "Index", "HomeController"})%></li>
Now I wish to add a querystring to Link B so when it points to the following URL http://localhost:55556/HomeController/?Sort=LinkB
I want both links to point to the same controller so I can then detect if the queryString is present then point the appropriate link to a different view, some thing like...
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult Index()
{
var linkChoice = Request.QueryString["Sort"];
if (linkChoice == "LinkB")
{
return View("ViewB");
}
else
{
return View("ViewA");
}
}
Thanks for the help.