Checkbox items not read when going back on the page

1 posts, 0 answers
  1. Violeta
    Violeta avatar
    1 posts
    Member since:
    Feb 2017

    Posted 07 Feb 2017 Link to this post

    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

Back to Top