checkbox list and radio button list

P

puja

hi all,

I have a form which has checkbox list which has items as below

1) Input 1
2) Input 2
3) Input 3
4) Input 4
5) Input 5

Now if user selects Input2 and Input5 and goes to next page and then comes
back to this page, I want to retain the selected Item that he selected
before. i.e Checkboxlist should display Input 2 and Input 5 as checked and
now if wants to change his selection to Input 1 and Input 5, he can change
his selection and proceed to next page.

My problem is I don't know how to retain the selection that he made
previously. i.e how do i store items that he selected at the first time when
he visited the page.

Same problem with RadioButtonList. :(

Pls help.......
 
T

Tasos Vogiatzoglou

You should use a Session variable. E.g.

Session["selection"] = <selectionValue>;

and in the same page

if (!IsPostback) {
if (Session["selection"] != null ){
ParseSelectionValue(Session["selection"]);
}

Does this help you ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top