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

RadcomboBox Items to Session Array

1 Answer 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sucheta Patil
Top achievements
Rank 1
Sucheta Patil asked on 27 Sep 2010, 02:49 PM
Hi
How do I add Items of RadcomboBox to a session.

I have a lstCourseCode to give back Tutor Emails which I want to store for each coursecode.

I probably have to use session array?
I dont know the length of array for Items.It will be dynamic.
And each item (lstCourseCode.SelectedItem.Text) should be stored in Session array.
On the same page OnClick of Submit I restore each of the session value to send emails.

Any suggestions !!!!


1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Sep 2010, 01:05 PM
Hello,


Here is the code that I tried for a similar scenario to save the RadComboBoxItmes in a session?

Code for saving the session:
Array arr = RadComboBox5.Items.ToArray();
Session["save"] = arr;


Retrieving from the session:
Array a = (Array) Session["save"];
for( int i=0; i< a.Length; i++)
{
     RadComboBox6.Items.Add(new RadComboBoxItem((a.GetValue(i) as RadComboBoxItem).Text));  
}


-Shinu.
Tags
General Discussions
Asked by
Sucheta Patil
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or