473,772 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changes with Radiobutton selection

I placed the following code into my page, but i get an error message,
why?

The code is:
if (this.RadioButt onContatto.Chec ked == "YES")

The error message is:
CS0117: 'System.Web.UI. WebControls.Rad ioButtonList' does not contain a
definition for 'Checked'

Where is the error? what else should i use for the radiobutton
selection changes?

Thanks

Oct 8 '07 #1
3 1657
'Checked' is a bool property of the RadioButtonList .

So, you would replace that with

if (this.RadioButt onContatto.Chec ked)
{
...
}



"Vinnie" <ce**********@g mail.comwrote in message
news:11******** **************@ v3g2000hsg.goog legroups.com...
>I placed the following code into my page, but i get an error message,
why?

The code is:
if (this.RadioButt onContatto.Chec ked == "YES")

The error message is:
CS0117: 'System.Web.UI. WebControls.Rad ioButtonList' does not contain a
definition for 'Checked'

Where is the error? what else should i use for the radiobutton
selection changes?

Thanks

Oct 8 '07 #2
On Oct 8, 9:14 am, "Troye Stonich" <ston...@gmail. comwrote:
'Checked' is a bool property of the RadioButtonList .

So, you would replace that with

if (this.RadioButt onContatto.Chec ked)
{
...

}

Ok, thanks, but i have two options: how do i make the system do
something if one of this two options is selected?

For example: if selected YES, do this, else do something else.

My problem is that having a Radiobutton list, i need the system do
something only if the YES button is checked.

Thanks

Oct 8 '07 #3
ok sorry, you'll have to look at the "SelectedVa lue" string property of the
RadioButtonList .

if (this.RadioButt onContatto.Sele ctedValue == "YES")
{
...
}

"Vinnie" <ce**********@g mail.comwrote in message
news:11******** **************@ o3g2000hsb.goog legroups.com...
On Oct 8, 9:14 am, "Troye Stonich" <ston...@gmail. comwrote:
>'Checked' is a bool property of the RadioButtonList .

So, you would replace that with

if (this.RadioButt onContatto.Chec ked)
{
...

}


Ok, thanks, but i have two options: how do i make the system do
something if one of this two options is selected?

For example: if selected YES, do this, else do something else.

My problem is that having a Radiobutton list, i need the system do
something only if the YES button is checked.

Thanks

Oct 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
7874
by: William Gill | last post by:
I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep references to them in a 2 dimensional list ( rBtns ). It works fine, and I can even make it so only one button per column can be selected, by assigning each column to an intVar. In many languages a radiobutton has a property that can be directly read to see if it is selected on unselected. Tkinter radiobuttons don't seem to have any such property. Is there any way to...
1
3843
by: R.G. Vervoort | last post by:
I would like to make a script wich makes a select visible or not visible depending on what radio button is selected. If the radiobutton with the value "nieuw" is selected the pulldown is not visible and when i select the radiobutton with the value "verwijderen" the pulldown should become visible. The code i have makes the pull down visible but does not make it invisible after i select another radiobutton.
1
1576
by: Sean | last post by:
hi, I have a radiobutton list say, Florida | New York | New Jersey | Texas the radiobutton list has autopostback set to true, as i fire up some code after one of the radiobuttons are selected. Now, i want to be able to traverse the radiobutton using only the keyboard, as i am firing a sql based on the selection, i can't seem to be able to pick Texas as a option, because once Florida is highlighted the sql is fired.
2
1431
by: Scott Natwick | last post by:
I am having trouble validating that a selection has been made from a RadioButton. I created a script to trigger from a CustomValidator, however, it only works when I run the app locally, from the debugger. Once I upload it to the server and run, the script no longer triggers. Any ideas? Thanks in advance,
1
1472
by: gh | last post by:
I am using the 1.1 .netframework and I use the template code below to define a radio button in the grid rows. <ASP:TemplateColumn headertext="Select"> <HeaderStyle width="50px"></HeaderStyle> <ItemStyle wrap="False" horizontalalign="Center"></ItemStyle> <ItemTemplate><asp:RadioButton id="cbSelect" groupname="Select" runat="server"></asp:RadioButton> </ItemTemplate> <FooterStyle wrap="False"></FooterStyle>
0
881
by: K B | last post by:
Hi, I have a standard radiobuttonlist control (rbl) in VS2005. I set the values right in the control, not by a dataset. I have 4 items, with index 0, 1, 2, and 3. Since the control does not appear to function correctly (sometimes selections are lost), I put a postback on it and put in an event to determine the selectedindex and the selectedvalue, etc.
5
11657
by: Matt B | last post by:
I know this is a bit of nonstandard behavior, but I would like the Enter key to move focus through a group of radiobuttons without selecting them. The user would then have to use Space or actually click to select one of the radiobuttons to select. The default behavior of Focus() seems to also select the radiobutton, but I can't seem to find what is causing this to happen. I would like very much to seperate the Focus and the selection....
0
1787
by: BizEd | last post by:
I have a textbox that fires an autopostback when filled in. The next field after the textbox is a RadioButtonList which I set focus to. The radiobutton list does have focus and activates when you hit the spacebar, but the little selection box does not appear around the first item like it does when you tab to a radiobutton list. So in essence, the user has no idea where they are on the screen. I've tried both the focus() method and...
0
1543
by: Emma Middlebrook | last post by:
Hi there, I'm having problems in an ASP.NET page that is dynamically creating and displaying radio buttons. I have setup a checkchanged event and specified AutoPostBack to true. When the page loads none of the radio buttons are checked by default. When the user checks the first one, the page refreshes but the checkchanged event never triggers. If you then select a different radio button, the postback occurs but the event also triggers.
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.