Prasad Bhagat

Prasad Bhagat

  • NA
  • 516
  • 235.5k

transfer and recieve checkboxlist items using server.transf

Aug 11 2014 2:03 AM
Dear all,

how to transfer and recieve the checkboxlist items using server.transfer()


default.aspx
-------------
<asp:checkboxlist id="checkboxlist1" runat="server" >
<asp:ListItem>Banglore</asp:ListItem>
  <asp:ListItem>Hyderabad</asp:ListItem>
  <asp:ListItem>Chennai</asp:ListItem>
</asp:checkboxlist>

deafult.aspx.cs
---------------
page_load
{

  Context.Items.Add("location", CheckBoxList1.SelectedItem.ToString());
  Server.Transfer("Default1.aspx",true);
}


Default1.aspx
-----------------
<asp:checkboxlist id="checkboxlist1" runat="server" >

</asp:checkboxlist>


Default1.aspx.cs
-----------------------

page_load

{
how to recieve all selected listitems to this checkboxlist
using context


  string location = Context.Items["location"].ToString();
  CheckBoxList1.Items.Add(location);
}