Been working on this for 4 hours now!
1. I have a checkboxList on page xyz.aspx
2. There's a seach link on this page. User clicks it, goes to search.aspx. Selects a row. I pass the id to xyz.aspx page
3. I use this ID and call the database, get a value and bind to checkboxList. So far so good.
4. But now, user might leave this page again and go to search and get another id. Now, I have 2 ids.
5. When I get back to page xyz.aspx, I want to bind both Ids to the checkboxlist. I'm thinking about using a session var and loop thru the session and bind bit not sure how to do this.
This is my code:
if (Session["providerId"] != null)
List<usp_LoadProviderNameResult> provider = sd.LoadProvider(ReferredToProviderId);
ckProviders.DataSource = provider;
ckProviders.DataTextField = "Providername";
ckProviders.DataValueField = "Id";
List<string> selectedProviders = new List<string>();
Session["providerId"] = selectedProviders;