how to maintain radio button check on multipages in asp.net
can anybody tell me how can i maintain the radiobutton check on multipages, i have four pages each page have four radiobutton user just choose one and go next page if he/she wanted to return the previous page so previous page show the checked radiobutton
Nitin SharmaPosted Apr 10, 2014, 2:37 AM
Brijendra GautamPosted Apr 9, 2014, 4:44 AM
Default.aspx: used RadioButtonList
Default2.aspx: used same Radio button and saved the client Id of selected radio.
Nitin SharmaPosted Apr 9, 2014, 2:45 AM
Thanks
Brijendra GautamPosted Apr 8, 2014, 12:19 PM
Session["page1"]= rbtn.SelectedValue;
Page_Load:
If(Session["page1"]! = null)
rbtn.SelectedIndex = rbtn.Items.IndexOf(rbtn.Items.FindByValue(Session["page1"].ToString(
)));
I''ve done it for page1. Likewise you need to do it for all other pages. And also put the same code on previous button click.
Nitin SharmaPosted Apr 8, 2014, 8:45 AM
Thanks in advance
Brijendra GautamPosted Apr 8, 2014, 8:14 AM
You can use any of the asp.net state management approach to store data for multiple pages.
Ex. store it in XML and reload the radio button by reading it from XML.
Can also use session, cookiee etc.