I have a ListView
and i use the SelectMethod
of the ListView
to populate it. I am looking to apply filters to the data returned from a DropDownList
. The problem that i am facing is i cannot DataBind()
on this ListView
because of the SelectMethod
that is uses.
So figure i would change that and DataBind()
the whole time instead of using the SelectMethod
(Is that better?). Then the problem I face is my method was grabbing [RouteData]
. Right now i am grabbing the [RouteData]
as a param to my method. Please see below.
public IQueryable<Product> GetProducts([RouteData] string categoryName, , [RouteData] string brandName, [RouteData] string subCatName)
{
//Do stuff
}
below is the ListView
<asp:ListView ID="productList" runat="server"
DataKeyNames="ProductID"
ItemType="E_Store_Template.Models.Product"
SelectMethod="GetProducts">
// do stuff
</asp:ListView>
How can I use DataBind()
and still grab the [RouteData]
from URL? Or do i have to use QueryString to do this?