473,410 Members | 1,930 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,410 software developers and data experts.

Radiobutton Issue

In html and ASP, I would easily code radio buttons as needed, such as:

<input type="radio" name="question1" value="1">1</input>&nbsp;
<input type="radio" name="question1" value="2">2</input>&nbsp;
<input type="radio" name="question1" value="3">3</input>

If I use the <asp:radiobuttoncontrol, I can do this:

<asp:RadioButton ID="RB1" GroupName="question1" runat="server" />1
<asp:RadioButton ID="RB2" GroupName="question1" runat="server" />2
<asp:RadioButton ID="RB3" GroupName="question1" runat="server" />3

My problem with this is that I can't specify a value. When the form is
filled out, I need a value between 1 and 5 to be inserted into the
database. In the above example, the value is actually whatever the ID is
and since I can't have duplicate IDs, then that rules out the use of
<asp:RadioButton />.

The <asp:radiobuttonlist /would probably work ok but I can't place the
radio buttons (the <asp:listitem />) side by side. It only puts the
radio buttons vertically.

<asp:RadioButtonList ID="RBL1" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:RadioButtonList>

Looking at the source after the page is rendered, I can see that it
creates a table to display the radiobuttons. The value is present
though, which is what I would need for my database.

I was hoping to not use <inputtags this time around and use more
'advanced' coding techniques, but I don't know how I would go about
using server controls considering my display and value requirements.

Any input would be appreciated.

TIA,
Jim
Sep 14 '06 #1
4 4678
asp.net controls all use the Text property to render the value.
-- bruce (sqlwork.com)
"Jim in Arizona" <ti*******@hotmail.comwrote in message
news:O2**************@TK2MSFTNGP04.phx.gbl...
In html and ASP, I would easily code radio buttons as needed, such as:

<input type="radio" name="question1" value="1">1</input>&nbsp;
<input type="radio" name="question1" value="2">2</input>&nbsp;
<input type="radio" name="question1" value="3">3</input>

If I use the <asp:radiobuttoncontrol, I can do this:

<asp:RadioButton ID="RB1" GroupName="question1" runat="server" />1
<asp:RadioButton ID="RB2" GroupName="question1" runat="server" />2
<asp:RadioButton ID="RB3" GroupName="question1" runat="server" />3

My problem with this is that I can't specify a value. When the form is
filled out, I need a value between 1 and 5 to be inserted into the
database. In the above example, the value is actually whatever the ID is
and since I can't have duplicate IDs, then that rules out the use of
<asp:RadioButton />.

The <asp:radiobuttonlist /would probably work ok but I can't place the
radio buttons (the <asp:listitem />) side by side. It only puts the radio
buttons vertically.

<asp:RadioButtonList ID="RBL1" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:RadioButtonList>

Looking at the source after the page is rendered, I can see that it
creates a table to display the radiobuttons. The value is present though,
which is what I would need for my database.

I was hoping to not use <inputtags this time around and use more
'advanced' coding techniques, but I don't know how I would go about using
server controls considering my display and value requirements.

Any input would be appreciated.

TIA,
Jim

Sep 14 '06 #2
bruce barker (sqlwork.com) wrote:
asp.net controls all use the Text property to render the value.
-- bruce (sqlwork.com)
Thanks Bruce. I'll see what I can do with that info.
Sep 14 '06 #3
Hi Jim,

the radiobuttonlist has a property named "RepeatColumns" which actually
is the number of radiobuttons to display in one row. Maybe this helps as
well.

Kind Regards,

Roland

Jim in Arizona schrieb:
The <asp:radiobuttonlist /would probably work ok but I can't place the
radio buttons (the <asp:listitem />) side by side. It only puts the
radio buttons vertically.
Sep 14 '06 #4
Roland Dick wrote:
Hi Jim,

the radiobuttonlist has a property named "RepeatColumns" which actually
is the number of radiobuttons to display in one row. Maybe this helps as
well.

Kind Regards,

Roland

Jim in Arizona schrieb:
>The <asp:radiobuttonlist /would probably work ok but I can't place
the radio buttons (the <asp:listitem />) side by side. It only puts
the radio buttons vertically.
Thanks Rick. That's actually was I was looking for. :)
Sep 15 '06 #5

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

Similar topics

8
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from...
3
by: sofie | last post by:
Hello all, I use the following javascript function in a html document to set the level of one of eight available radiobuttons. The line that's commented out works fine under IE, but I need to...
3
by: dave | last post by:
I have half a dozen web form radio buttons on a web form. Each of them is set to postback=true. However, if for instance radiobutton1 is already selected and the user selects it again, it performs...
0
by: Alan Samet | last post by:
If you need to get in touch with me, be sure to remove the "newsgroups" from my email address. I've developed a quick-and-dirty workaround for putting System.Web.UI.WebControls.RadioButton...
3
by: visual2005beta_developer | last post by:
I have the following problem (especially with the groupname-attribut of the RadioButton-Control) when developing in Visual Studio 2005 Beta. I load an ascx-control in an aspx-page. This...
6
by: Radiobutton via DotNetMonster.com | last post by:
i need help with radiobuttons. i am useing 1button and 2 radiobuttons i am trying to make it so when u select a radiobutton and hit button1 it will clear radiobuttons 1 and 2. -- Message...
4
by: Igor | last post by:
RadioButton have property Checked (true or false). If I make RadioButtons with code, without drawing by mouse than I have problems. I write like this: Dim rb(0 To 2) As RadioButton Dim n As...
2
by: Mufasa | last post by:
How can I make an asp:radiobutton where when the user selects it it runs javascript code? I've tried doing the following but it doesn't seem to work: ...
8
by: =?Utf-8?B?UmljaA==?= | last post by:
If you enclose a group of radiobuttons (option buttons in MS Access) in an option group control (a frame control) in Access -- the frame control will return the index of the option button that is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.