473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Formatting Radios

Hi everyone,

At the moment I am using the syntax of:

<asp:radiobuttonlist id="rdDrive" runat="server" RepeatLayout="Table"
RepeatColumns="2">
<asp:ListItem Value="1" text="Yes"></asp:ListItem>
<asp:ListItem Value="0" text="No"></asp:ListItem>

</asp:radiobuttonlist>

But what I prefer to do to give me greater layout flexibility is have
one radio in one <TD> cell and another in another <TD> cell. So headers
can be added above the corresponding radio buttons (instead of the side
of the radio).

I know I can use:

<asp:RadioButton id="radio1" groupname="Drive" runat="server" />

<asp:RadioButton id="radio2" groupname="Drive" runat="server" />

but when it comes to requesting the value of the "Drive" group is there
a neat way to loop round the Drive group and find the selected value? (I
may have many radios in the Drive group and don't want to request each
an every radio to see if it is selected.)


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
4 1176
Request.Form("Drive") would do it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Angela" <an**@email.com> wrote in message
news:uu**************@TK2MSFTNGP10.phx.gbl...
Hi everyone,

At the moment I am using the syntax of:

<asp:radiobuttonlist id="rdDrive" runat="server" RepeatLayout="Table"
RepeatColumns="2">
<asp:ListItem Value="1" text="Yes"></asp:ListItem>
<asp:ListItem Value="0" text="No"></asp:ListItem>

</asp:radiobuttonlist>

But what I prefer to do to give me greater layout flexibility is have
one radio in one <TD> cell and another in another <TD> cell. So headers
can be added above the corresponding radio buttons (instead of the side
of the radio).

I know I can use:

<asp:RadioButton id="radio1" groupname="Drive" runat="server" />

<asp:RadioButton id="radio2" groupname="Drive" runat="server" />

but when it comes to requesting the value of the "Drive" group is there
a neat way to loop round the Drive group and find the selected value? (I
may have many radios in the Drive group and don't want to request each
an every radio to see if it is selected.)


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
thanks for the reply, didn't think of that!

but it will only return the name of the radio not the value (as I think
you can't assign values to asp:radio can you??)

also how would you select the correct radio if you were to revisit the
page?

at the moment I am using syntax like this:
rdDrive.SelectedIndex =
rdDrive.Items.IndexOf(rdDrive.Items.FindByValue(my Personality.Drive))

how would you do this with a group?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
> but it will only return the name of the radio not the value (as I think
you can't assign values to asp:radio can you??)
It will return the value of the selected radio button in that group. The
name of the group is "Drive".
also how would you select the correct radio if you were to revisit the
page?
Depends on how you define "the correct radio" and "revisit the page."
how would you do this with a group?
Do you mean a RadioButtonGroup? I thought we were talking about individual
RadioButtons.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Angela" <an**@email.com> wrote in message
news:O5**************@tk2msftngp13.phx.gbl... thanks for the reply, didn't think of that!

but it will only return the name of the radio not the value (as I think
you can't assign values to asp:radio can you??)

also how would you select the correct radio if you were to revisit the
page?

at the moment I am using syntax like this:
rdDrive.SelectedIndex =
rdDrive.Items.IndexOf(rdDrive.Items.FindByValue(my Personality.Drive))

how would you do this with a group?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #4
Sorry I wasn't making myself clear (friday slump)

OK, I have a page that is an add and edit page.

Once the data is submitted and the user wants to edit the data, the
radios will have to be pre selected according to values they previously
submitted.

So say I have radios:

<asp:RadioButton id="RadioButton1" groupname="Drive" value="1"
runat="server />
<asp:RadioButton id="Radiobutton2" groupname="Drive" value="2"
runat="server" />

and the value I get back from DB is 1, how would I get it to pre select
the correct radio button from the group "Drive" when the page is loaded?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #5

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

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
2
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with...
4
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
1
by: GGerard | last post by:
Hello Is there a way to use a variable in the Conditional Formatting of a Textbox? Example : I want the background of a textbox in a continuous form to change color when the value of...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
7
by: L. Scott M. | last post by:
Have a quick simple question: dim x as string x = "1234567890" ------------------------------------------------------- VB 6 dim y as string
8
by: gopal | last post by:
Hi I am trying to write to log file but the formatting of string is not properly aligned in log file result The results looks some thing like this OK move.xml Successful OK ...
8
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.