In my application I have an area with several category links that is a PartialView.
The following categories come from the following Categories of ControlController
var categorias = db.Categorias.ToList();
Shoes | Health and Beauty | Supermarkets | Restaurants
The ActionResult of the encoded PartialView below knows which link the user clicked through a TempData ("SelectedSelect") .
[AllowAnonymous]
public ActionResult _CatalogoFiltroCategoria()
{
TempData.Keep("filtroSelecionado");
var categorias = db.Categorias.ToList();
return PartialView(@"~/Views/Anuncios/_CatalogoFiltroCategoria.cshtml", categorias);
}
How do I get the var categories to put the selected link as the first of the ToList ().
Click on Restaurants to return the list to me.
Restaurants | Shoes | Health and Beauty | Supermarkets
Click on Health and Beauty and return to the list with Health and Beauty at the top of the list
Health and Beauty | Shoes | Supermarkets | Restaurants