473,320 Members | 2,164 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,320 software developers and data experts.

Dynamic Radiobuttonlist

Hi.

I'm trying to make a dynamic radiobuttonlist for my site. I've found the code for it by googling and i get how its done, but i cant see to get my references working. I've added the System.Windows.Forms reference, and "using" at the top of the page. (some more googling told me that that was the appropriate reference) but i'm still getting this error message:

The type or namespace name `RadioButtonList' could not be found. Are you missing a using directive or an assembly reference?(CS0246)

Heres the code for the radiobuttonlist:
Expand|Select|Wrap|Line Numbers
  1. //create dynamic radiobuttonlist 
  2. RadioButtonList rblTest = new RadioButtonList(); 
  3. rdoMoreRooms.ID = "rblTest";
  4. rdoMoreRooms.AutoPostBack = true; 
  5. //rdoMoreRooms.SelectedIndexChanged += new System.EventHandler(this.radioButton_Check_Changed); 
  6. rdoMoreRooms.RepeatDirection = RepeatDirection.Horizontal; 
  7. rdoMoreRooms.Items.Add(new ListItem("Cake", "Cake")); 
  8. phMoreRooms.Controls.Add(rblTest); 
  9. phMoreRooms.Controls.Add(new LiteralControl("<p>"));    
  10.  
  11.  
I've tried to find a tutorial for this, but it seems to be impossible to find. So i'm hoping that someone here knows how to do it :)
May 15 '09 #1
2 12405
IanWright
179 100+
@vegtard
The easiest way to add using statements (if you are using visual studio) is to use the context menu or right click and select Resolve. If the correct DLL is there it will automatically give you a list of all the namespaces that the class exists in.

If you're not sure on the namespace, a quick google on the class name should return the namespace, or just use the MSDN site directly. What you'll find is that the RadioButtonList is actually contained in the System.Web.UI.WebControls namespace.
May 15 '09 #2
Radiobuttonlist in c#....

I have created form with 4 radio buttons.I have choose only one radio button.When i click radio button, the selected value is stored in database.How to write code in c#? In ASP.net one control is available called radiobuttonlist.But in windows application radiobuttonlist not available?

please send me coding?

m.rajkapoor@gmail.com
Dec 5 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Shamin | last post by:
Hi All, I'm refering to the code in this article. http://www.dnzone.com/ShowDetail.asp?NewsId=151 I'm trying to do the same in VB.NET and I'm having problems with procedure...
2
by: Brian | last post by:
I have a datagrid that is listing a bunch of questions from my DB.. I am creating a radiobuttonlist for each question to give me a yes or no answer. I would like to use the "QuestionCode" column...
5
by: Mike Salter | last post by:
I created a page that reads a DB for questions and possible answers (usuallyYes/No). I create a panel for each group of questions, and add a panel for each question to the Group panel. To the...
4
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control on a Panel control during the 1st load_page event....
0
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...
4
by: rn5a | last post by:
Assume that a ASPX page uses a user control named Address.ascx which has 2 TextBoxes. This ASCX page creates 2 properties named 'Address' & 'City' using the Get & Set statements: <script...
3
by: Raj | last post by:
Hi there, I am trying to get this work but I can't figure a solution. I have a table on a web page (.aspx) and creating the table contents dynamically. I have two cells for each row of table....
0
by: mcheng2 | last post by:
Dynamically added RadioButtonList with AutoPostBack = true. On the first postback, SelectedIndex is not updated. For example: SelectedIndex starts at -1. Click Radio #1, SelectedIndex = -1....
13
by: tommymo | last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
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...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.