Based on my understanding i found that we can code from the View also. So i have a list which is populated in View using foreach loop.
@foreach (var item in Model)
{
@Html.Raw(item.Name)<br />
@Html.Raw(item.Price)<br />
@Html.Raw(item.Description)<br />
@Html.Raw(item.Image)
<hr />
}
I also have a dropdown list outside the foreach loop where i want to sort using the price.
I can get this action done by passing the model to the controller but here the page refreshes completely, which is something i dont want to happen. Inturn i wanted only the Model to be sorted dynamically say using a javascript to refine the items in Model which has a list. Any help would be appreciated.