Monday, 19 August 2013

ASP.net MVC 4 Controller Funtions

ASP.net MVC 4 Controller Funtions

I have an application where I have to display data in a table format. The
end user has four different ways they want this displayed so I have one
model with different LINQ statements on each controller to manipulate the
data. I have two shared views that hold the controls (filter options drop
downs, text boxes, etc...) and the result set.
My question is this: How can I sub out repetitive functions? I have drop
down boxes that I use to filter the result set and, forgive my ignorance,
I call the same LINQ statement on each controller to load the ViewData for
that drop down.
as you can see this is very inefficient, I have added a "UtlityController"
to the project in hopes that I can place this function and a few others
there, but still have the same output on the View... I haven't figured it
out yet and thought I would reach out to the community for help.
Thanks in advance.

No comments:

Post a Comment