HomeHome Product Discus... Product Discus...SmithCartSmithCartv4.24 ProductsList.ascx: Records Drop Downv4.24 ProductsList.ascx: Records Drop Down
Previous
 
Next
New Post
3/19/2011 11:21 PM
 
Bug: Records drop down list is reset navigating to view cart then continue shopping. The user selected option should persist with the user session.

Headache: The records drop down list uses hard coded values that require manual changes to in ProductsList.aspx every time SmithCart is upgraded.

Suggestion: A new module setting called ProductsPerPageList with comma separated values. This allows precise control of the records drop down and would retain values across upgrades.

Implementation in Page_Load:

ddlRecords.Items.Clear(); // not needed if listitems are removed from aspx
string pppList = "10,20,50,100"; // default products per page list
if (Settings["ProductsPerPageList"] != null)
pppList = Settings["ProductsPerPageList"].ToString(); // override with module settings
string[] pppItems = pppList.Split(',');
foreach (string pppItem in pppItems)
{
ddlRecords.Items.Add(pppItem); // populate listitems
if (pppItem == records.ToString()) // saved in user session by SelectedIndexChanged
ddlRecords.SelectedValue = pppItem; // select known valid listitem (prevents invalid itemlist errors)
}
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartv4.24 ProductsList.ascx: Records Drop Downv4.24 ProductsList.ascx: Records Drop Down