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