I have read various articles about the modal state that is used in the ASP.NET MVC. I have read this article link text from Scott Gu. I have some code in my controllers that are hitting the database every time a select list is need to display an error. Is there any way to have the modal state save the lists contents? Or maybe cache the lists?
// controller code
// re display the error do to a business rule violation
_ratesViewData.FSCCOde = getFscCode(_rateService.GetFscCode());
// controller code
private SelectList getFscCode(IEnumerable items, object selectedValue)
{
return new SelectList(items, "FscID", "FscCode", selectedValue);
}
// ASP.NET MVC control code
// ASP.NET MVC control code
// ASP.NET MVC control code
Fuel Surcharge Code
<%=Html.DropDownList( "FscCode", "No Fuel Surcharge")%