Checkbox items not read when going back on the page

Feb 8 2017 11:38 AM

Hi,

The first time I click on submit on my form, the values from the RadListBox are read, but when going back on the page although the same items are still selected if I click submit for the second time, the values of the item selected are read as null. I have to actually uncheck and check again the items from the list for this to be read again. Do you know what might be the issue here?

This is what I have on my search.aspx.cs file:

int eCount = 0;
String strEvalReasonList = String.Empty;


IList<RadListBoxItem> collectionEvalReasons = rlbEvalReasons.CheckedItems;
foreach (RadListBoxItem exp in collectionEvalReasons)
{

// Response.Write(exp.Value + ":" + exp.Text + "<BR>");


// foreach (RadListBoxItem exp in rlbEvalReasons.CheckedItems)
// {

if (exp.Value.ToString() == "All")
{
Session["EvalReasonList"] = null;
break;
}
else
{
if (eCount > 0)
{
strEvalReasonList += ",";
}
strEvalReasonList += "'" + exp.Value.ToString() + "'";
eCount++;
}
}
if (strEvalReasonList==String.Empty)
{
Session["EvalReasonList"] = null;
}
else
{
Session["EvalReasonList"] = strEvalReasonList.ToString();
}

Thanks


Answers (1)