Run different stored procedures based on user input

I have an ASP.Net page (C# code behind) that displays data in a grid. The OnLoad event runs a stored procedure to get the data from the database and display the grid (an asp:repeater, actually). I have placed 5 buttons at the top of the page. When the page is loaded (as a user comes to it) a default stored procedure is run. I want each of the buttons to run a different stored procedure that accepts a different parameter. Right now, the page opens and displays all open records. When clicking the Archived button, all archived records will display. When clicking the Returned records, all of the records marked as returned will display. And so on. The parameter is simple, a status field that is a number. What would be the best way to implement this?
Who is Participating?
if all the data is already in the client side, add class to the rows and with jquery hide/show relevant rows.
if server side you have at least 2 options
1) use linq to filter the result (to better performance save the first result and use it in the next page calls)
2) pass a parameter to the stored procedure that will filter records as needed
dodgerfanAuthor Commented:
Perfect, thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.