This is a migrated thread and some comments may be shown as answers.

Checkbox items not read when going back on the page

0 Answers 13 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Violeta
Top achievements
Rank 1
Violeta asked on 08 Feb 2017, 12:01 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

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Violeta
Top achievements
Rank 1
Share this question
or