I have show you this example with dummy values in the CheckBoxList and ListBox
Default.apx
<asp:ListBox ID="lbItems" runat="server" OnSelectedIndexChanged="lbItems_OnSelectedIndexChanged"
AutoPostBack="true">
<asp:ListItem Text="PC" Value="PC" />
<asp:ListItem Text="LapTop HP" Value="LapTop HP" />
<asp:ListItem Text="DELL" Value="DELL" />
<asp:ListItem Text="Key Board" Value="Key Board" />
</asp:ListBox>
<hr />
<asp:ListBox ID="lbSelected" runat="server"></asp:ListBox>
<br />
<asp:Button ID="Button1" Text="Next" runat="server" OnClick="Next" />
Default.aspx.cs
protected void Next(object sender, EventArgs e)
{
List<ListItem> seletedItem = new List<ListItem>();
foreach (ListItem item in this.lbSelected.Items)
{
seletedItem.Add(item);
}
Session["SeletedItem"] = seletedItem;
Response.Redirect("~/Default2.aspx");
}
protected void lbItems_OnSelectedIndexChanged(object sender, EventArgs e)
{
this.lbSelected.Items.Add(new ListItem(this.lbItems.SelectedItem.Value, this.lbItems.SelectedItem.Value));
}
Default2.aspx
<asp:CheckBoxList ID="chkSeletedItems" runat="server">
<asp:ListItem Text="PC" Value="PC" />
<asp:ListItem Text="LapTop HP" Value="LapTop HP" />
<asp:ListItem Text="DELL" Value="DELL" />
<asp:ListItem Text="Key Board" Value="Key Board" />
</asp:CheckBoxList>
Default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
List<ListItem> selectedItem = (List<ListItem>)Session["SeletedItem"];
foreach (ListItem item in selectedItem)
{
this.chkSeletedItems.Items.FindByValue(item.Text).Selected = true;
}
}
}
Screenshot