Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

radio button not updated after make change asp.net c#

I have this set of buttons in asp.net c# webapp:

                <asp:TableCell ID="TableCell8" runat="server" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"><center><asp:RadioButton id="a1a" Text="" Checked="True" GroupName="pra1" runat="server"/></asp:TableCell>

				<asp:TableCell ID="TableCell11" runat="server" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"><center><asp:RadioButton id="a1b" Text="" Checked="False" GroupName="pra1" runat="server"/></asp:TableCell>

				<asp:TableCell ID="TableCell14" runat="server" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"><center><asp:RadioButton id="a1c" Text="" Checked="False" GroupName="pra1" runat="server"/></center></asp:TableCell>  

Open in new window


Now via the page load in asp,net c# we make changes to text boxes and radio buttons and then the user is control after that to make new changes.

However when the user submit a new change that changes are not stored and we know that issue happens for the post back issue. Now for text boxes we solved with a command like this: "Request.Form[a1a.ClientID]". That worked perfect for text boxes but for radio buttons we don't know how.  What can we do for radio buttons? or is there ipa a similar command like "Request.Form[a1a.ClientID]" but for radio buttons? What we want to check is the new status if true or false of the radio button of the new user selection but i. code behind and after a change store. Like I mentioned before we had the same problem with text boxes and we solved just storing the value of "Request.Form[a1a.ClientID]" and simply like that we don't if there is a similar command for radio buttons.

Thank you
0
Alex E.
Asked:
Alex E.
1 Solution
 
zephyr_hex (Megan)DeveloperCommented:
You can get the selected state of a radio control from code behind doing:
a1a.Checked

Open in new window


It will return true or false.

If you have a reason to reference Request.Form instead of the control itself, you can do:
Request.Form[a1a.UniqueID])

Open in new window


Please note:  ClientID is the id on the client side (so, for example, if you need to reference the control from JavaScript).  You want UniqueID to reference a control on server side.
0
 
Alex E.Author Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now