473,671 Members | 2,255 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 1652
'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
7862
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
3838
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
1571
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
1423
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
1465
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
874
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
11644
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
1781
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
1529
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
8476
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
8393
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
8820
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
8598
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
8670
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6223
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...
0
4224
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2810
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1809
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.