radio button problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avinash sh
    New Member
    • Feb 2009
    • 38

    #1

    radio button problem

    when i select on any of the radio of my page,, then click on select, page is redirected to there respective page, .. when i back on radiobutton page .. i want that no radio will display selected...? how can i achieve it?
  • bhupinder
    New Member
    • Feb 2009
    • 32

    #2
    radio button problem

    How to go back with browser back button or you are using any functionality for back.


    If you are not using browser back button then try this code.
    radio1.selected =false

    Comment

    • BeemerBiker
      New Member
      • Jul 2008
      • 87

      #3
      Originally posted by avinash sh
      when i select on any of the radio of my page,, then click on select, page is redirected to there respective page, .. when i back on radiobutton page .. i want that no radio will display selected...? how can i achieve it?
      I assume you want to re-populate your checkboxes. I had a dozen pages, each in a tab, each with grids and needing checkboxes to be repopulated. I stored my checkbox values in an array list in a session and used the following code to repopulate them. The name for each checkbox was "cbSelected " and strName was associated with the page the grid was on.
      Code:
      public void RePopulateCheckBoxes(string strName, GridView gv, int cellID)
              {
                  int chkID, nItems = gv.Rows.Count;
                  ArrayList CheckedItems = (ArrayList)Session["checkeditems" + strName];
                  if (CheckedItems == null) return;
                  for (int i = 0; i < nItems; i++)
                  {
                      CheckBox thisCB = (CheckBox)gv.Rows[i].FindControl("cbSelected");
                      if (thisCB == null) return;
                      chkID = int.Parse(thisCB.Text.ToString());
                      thisCB.Checked = CheckedItems.Contains(chkID);
                  }
              }
      HTH

      Comment

      Working...