473,770 Members | 5,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RadioButtonList and Selected

Jay
I have a radiobuttonlist like so

<asp:RadioButto nList id=radType RepeatDirection ="Horizontal " cellpadding="10 " cellspacing="0" runat="server"> <asp:ListItem value="Somethin g1"><font face="arial,hel vetica" size="2">Someth ing 1</font></asp:ListItem><a sp:ListItem value="Somethin g2"><font face="arial,hel vetica" size="2">Someth ing 2</font></asp:ListItem><a sp:ListItem value="Somethin g3"><font face="arial,hel vetica" size="2">Someth ing 3</font></asp:ListItem><a sp:ListItem value="Somethin g4"><font face="arial,hel vetica" size="2">Someth ing 4</font></asp:ListItem></asp:RadioButton List

The selected value of the radType is saved to a table

When opening the page, I am using a datareader to read a row in a table, I then need to make one of the items in the list selected based on what is in the table row. Eg

Dim DBConnection As SQLConnectio
Dim DBCommand As SQLComman
Dim DBReader As SQLDataReade
Dim SQLString As Strin
DBConnection = New SQLConnection(" connection string here"
DBConnection.Op en(
SQLString = "SELECT * from table1 where uid='" & request("uid") & "'
DBCommand = New SQLCommand(SQLS tring, DBConnection
DBReader = DBCommand.Execu teReader(
DBReader.rea
radJobType.sele ctedvalue=DBRea der("type")
DBReader.Close(
DBConnection.Cl ose(

This doesn't seem to work. How can I make the item in the radiobuttonlist selected based on the value in the row

Thanks

Nov 18 '05 #1
0 1017

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

Similar topics

3
9009
by: William LaMartin | last post by:
If I create a RadioButtonList with, say, two items, then after the page loads and I select one of the items and then click on a button whose click event contains some code to display the RadioButtonlList's selected value, there is nothing. On a postback, with the dynamically created button list visible on the page and the first item selected, if I try some code like "If Me.RadioButtonList1.Items(0).Selected = True Then.......", then I...
5
5511
by: DotNetGruven | last post by:
Anyone have any pointers on how to set the Value and Selected attributes in a ListItem in a RadioButtonList that is in a DataGrid? Here's what I have ------DataGrid------ -- BoundColumn 0 -- -- BoundColumn 1 -- -- BoundColumn 2 -- -- TemplateColumn 4 -- -- RadioButtonList --
4
9665
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater with like a table layout and in the last column I want to have three radio buttons (for each row in repeater). The value of the radio button should be calculated from a value from the dataset. How can I do that? When I try to use a variable...
3
1419
by: Mark Broadbent | last post by:
try as I might (and using different properties) this control always seems to be returning the first element of the control as the "selected" item even though I am selecting the second element. All I need it the index number to reference a particular row num of a dataset. I only just noticed this today but it if I cant determine the selected radiobuttonlist item then it reders this control useless. Hope someone can help? --
0
1976
by: Luis Esteban Valencia | last post by:
http://www.codeproject.com/aspnet/DataGridCCEvents.asp#xx1009236xx Read this first and see if you can help me have tried but the Intelisense of the radiobuttonlist doestn have the event selectedindexchanged? I have a datagrrid with an itemtemplate, inside this itemtemplate thre is a radiobuttonlist with 3 options. There is also a label to the side of this radiobuttonlist.
0
1277
by: Hugo Flores | last post by:
Hi, Here's the situation: I create a table on run time(Page_Init) I add a textbox to the first row I add a RadioButtonList in that same row The problem is that when I try to get the values that the user selected from the RadioButtonList I always end up getting the first item selected. At first my code had the first item selected by default, so I
4
4009
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load (page_load) i create dynamically an html table which contains a checkbox and a radiobuttonlist in each tablerow . The radiobuttonlist contains two items (yes,no). Both the checkboxes and the radiobuttonlist are NOT autopostbacked ( .autopostback = false). When i press the submit button a sub (submit_pressed) is run. My problem is that i can not get the selected items...
2
4739
by: Michael Bohman | last post by:
Hi, i have a small problem with assigning a database value to a RadioButtonList control. On my form i have 3 user admin=1, premium=2 and basic=3, theese values is stored in an access database in a text string. My problem is that when i'm loading my form, it uses a repeater control for each user by the way, I can't find a way to assign either of these values to the RadioButtonList Control. I can read them from the database but i wan't the...
6
2643
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered in the page and I've got code to get the selected value from it in the Radiobuttonlist_SelectedIndexChanged event. The code in there is: Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6679
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.