Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have scenario in which i am using radio buttons inside data list control.
But Now the Problem is this , that when we click on submit button the buttons got unchecked.
Can anybody tell me how to overcome this?
Posted

1 solution

1. Make sure ViewState is turned on.
2. Make sure you are not databinding during the PageLoad and if you are be sure to check for IsPostBack
3. Without seeing your code, you'll have to debug it.
 
Share this answer
 
Comments
Chandan Aryan 11-Apr-12 15:27pm    
I have Taken Care of all these things, but still its not working!!!
ZurdoDev 11-Apr-12 15:34pm    
What can we do to help? Can you share some code so we can see what is happening?
Chandan Aryan 11-Apr-12 15:36pm    
Its just a simple code , on button click m checking which button is checked but all buttons are false.
Chandan Aryan 11-Apr-12 15:37pm    
foreach (DataListItem item in dlShift.Items)
{
RadioButton control = ((RadioButton)item.FindControl("rbShift"));
if (control.Checked==true)
{
obj.ShiftID = Convert.ToInt32(((Label)(item.FindControl("lblShiftID"))).Text);
obj.Charges = Convert.ToDouble(((TextBox)(item.FindControl("txtCharges"))).Text);
obj.Save_ShiftDetails();
}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900