tags:

views:

162

answers:

1

What is the best way to enable site-wide filters in an ASP.NET MVC application?

To clarify, I have a form in my master page which has a drop down list =, the value of which filters every page on the site. Each individual page also has it's own form elements. I'd really rather not have a form element across the whole page (a la vanilla WebForms) but am having difficulty knowing what to call when the site-wide filter in the header is changed.

+1  A: 

I would probably use one small form on master page, and on Submit to its controller save value from dropdownlist to session.
Then every other controller can check value from session and do something with that, and also you can have many more forms on views also.
But again, maybe I didn't understood your question :)

Hrvoje
I agree, Assuming the filter data isn't too big, save the value into the session.
KyleLanser