Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

changes with Radiobutton selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinnie - 08 Oct 2007 14:08 GMT
I placed the following code into my page, but i get an error message,
why?

The code is:
if (this.RadioButtonContatto.Checked == "YES")

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

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

Thanks
Troye Stonich - 08 Oct 2007 14:14 GMT
'Checked' is a bool property of the RadioButtonList.

So, you would replace that with

if (this.RadioButtonContatto.Checked)
{
...
}

>I placed the following code into my page, but i get an error message,
> why?
[quoted text clipped - 10 lines]
>
> Thanks
Vinnie - 08 Oct 2007 14:23 GMT
> 'Checked' is a bool property of the RadioButtonList.
>
[quoted text clipped - 5 lines]
>
> }

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
Troye Stonich - 08 Oct 2007 14:33 GMT
ok sorry, you'll have to look at the "SelectedValue" string property of the
RadioButtonList.

if (this.RadioButtonContatto.SelectedValue == "YES")
{
...
}

>> 'Checked' is a bool property of the RadioButtonList.
>>
[quoted text clipped - 15 lines]
>
> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.