I am creating a view which initially pulls/display all the records on the page and later there are filters(textbox and checkbox) on left where user can filter the results from.
This is my first mvc app, so I have followed the below mentioned approach:
// GET: /Search/
public ActionResult Home(int page = 1)
{
SearchController have a Home method which is default and pushes the data to view to display in grid. Controls to filter the data is wrapped under:
@using (Html.BeginForm("Home", "Search", FormMethod.Post))
{
for that I have
[HttpPost]
public ActionResult Home(Partner partner)
My QUESTION is :
a) The search needs to be a query string based so that users can share the filtered result so what we be the best way to filter the Model data (partner here) via QS, I know I can either pass the whole model to the ActionResult or I can accept each field name in the AcitionResult.
b) How do you protect the QS params, the best practice ?
Thanks a lot in advance.