Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-09-30
2
Medium Priority
?
156 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.
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
zephyr_hex (Megan) earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

688 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