How do I bind a model during an action?
I have a dynamic url processor
public ActionResult DynamicUrl(string slug = null)
this method works via slug (btw what does slug stand mean?) and works if the slug displays a product or searches for a product.
As part of a product search, I have a page = 1 querystring parameter.
E.g. /Womens/Dresses?page=2
I used to do this in a normal product search activity that associates a page request with the ProductSearch model.
public ActionResult Results(ProductSearchModel searchModel)
How to bind a query string during an action? for example
public ActionResult DynamicUrl(string slug = null)
{
ProductSearchModel psm = new ProductSearchModel();
//Auto bind psm here.
// E.g. Controller.BindModel(psm);
}
Hope I disagree with this.
+3
source to share