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 / July 2007

Tip: Looking for answers? Try searching our database.

RadioButton Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ace - 25 Jul 2007 18:50 GMT
Hello,
How can I make RadioButtons to display all in the same row?  It looks that
one Radio button per line by default.
Secondly, I was wondering if there is a way to fire up Javascript when a
Radio Button is selected.  For example, depending on which Radio button gets
selected, I need to show/hide a text box.  Is it something I need to use
Asp.Net AJAX (or easier way)?

Thanks....a
Masudur - 26 Jul 2007 05:59 GMT
> Hello,
> How can I make RadioButtons to display all in the same row?  It looks that
[quoted text clipped - 5 lines]
>
> Thanks....a

hi...

why dont you use Radio Button List... and change the "RepeatDirection"
to "Horizontal"...
but if you dont want to use radioButtonList... use css to control the
flow of the radiobuttons...
drop them in single div.. and set style to display:inline;.....

about the javascript part... if you are on radio buttonlist... loop
through them items and then add onclick attribute and then set a
javascript

foreach (ListItem item in RadioButtonList1.Items)
           {
               item.Attributes.Add("onClick",
"window.alert('yahoo');");
           }
some thing like that...
in javascript fuction hide show the textbox... depending on the radio
checked or not...

Thanks
Md. Masudur Rahman (Munna)
Kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com
Ace - 26 Jul 2007 07:54 GMT
Thanx Masudur,
I have not added an event to a control and I assume I do this as part of
page load or init?

> > Hello,
> > How can I make RadioButtons to display all in the same row?  It looks that
[quoted text clipped - 32 lines]
> www.kaz.com.bd
> http://munnacs.110mb.com
Peter Bucher [MVP] - 26 Jul 2007 08:01 GMT
Hi Ace

> Secondly, I was wondering if there is a way to fire up Javascript when a
> Radio Button is selected.  For example, depending on which Radio button
> gets
> selected, I need to show/hide a text box.  Is it something I need to use
> Asp.Net AJAX (or easier way)?
The RadioButtonList provides a property named "AutoPostBack".
If the property set to true, a postback through javascript fired.
-
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.a
utopostback.aspx


Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET


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.