views:

776

answers:

3

Duplicate:

How can I build a tabbed menu in ASP.NET MVC?


If you hover over the tabs of Stackoverflow, you'll see query strings like "?tab=hot", etc... I'm looking to do something similar, and could use some pointers:

  • How can I select tabs based off the query string in ASP.NET MVC?
  • Should I process this in a view, or in a controller?


+1  A: 

I don't know how they do it as I haven't seen the source code but you could do that easily just by adding a parameter to your action method. Something like:

public ActionResult Questions(int id, string tab) {
    //...
}
Mehrdad Afshari
A: 

Without looking my guess would be that the controller sets various pieces of view data and the view displays differently based on those.

Spencer Ruport
+1  A: 

See this discussion here: http://stackoverflow.com/questions/978025/how-to-build-a-stackoverflow-tabbed-menu-in-asp-net-mvc

Talljoe
So this question is a dupe..
VVS