Solved

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

Posted on 2016-09-30
2
57 Views
Last Modified: 2016-10-03
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
Comment
Question by:Alex E.
2 Comments
 
LVL 42

Accepted Solution

by:
zephyr_hex earned 500 total points
ID: 41826789
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
 

Author Closing Comment

by:Alex E.
ID: 41826927
Thank you
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now