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

dynamically adding values to RadioButton

happy new year all of u...
sir,
iam using dataservice function of type int[] named getunbookedslots(DateTime dt) and the same is used for adding the returned datetime value to RadioButtonList of other .aspx page dynamically...
here is the Code in Page_Load() of page aspx.cs....
Expand|Select|Wrap|Line Numbers
  1. DataService myservices = new DataService();
  2.     protected void Page_Load(object sender, EventArgs e)
  3.     {
  4.         string s = "";
  5.         DateTime dt =  DateTime.Now ;
  6.         s = Request.QueryString["monthday"].ToString();
  7.         s = s + " " + Request.QueryString["monthdate"].ToString();
  8.  
  9.         RadioButtonList lt = new RadioButtonList();
  10.  
  11.         //lt.Items.Add("9.00 to 9.30 AM");
  12.         //lt.Items.Add("10.00 to 10.30 AM");
  13.  
  14.         int[] value = myservices.getunbookedslots(dt);
  15.         lt.Items.Add(value.ToString()); //i want to know the code to be replaced here//
  16.  
  17.  
  18.         cont.Controls.Add(lt);
  19.         Response.Write(s);
  20.  
  21.     }
  22.  
  23.  
Jan 1 '09 #1
2 1907
RedSon
5,000 Expert 4TB
It seems as though the radio button is the wrong type of control for this data, have you tried a combobox or a dropdown?
Jan 1 '09 #2
Frinavale
9,735 Expert Mod 8TB
@premprakashbhati
You haven't stated the problem that you're having.
In order for us to help you you need to tell us what the problem is and what you've tried so far to solve the problem.

It doesn't look like you correctly creating/declaring/using your controls dynamically.

Check out this article on how to use dynamic controls in ASP.NET to understand why you're having problems.

-Frinny
Jan 2 '09 #3

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

Similar topics

2
by: kea | last post by:
I have a checkbox and a textbox in a continuous taborder on a form along with a bunch of other controls. The textbox is disabled. When I leave the checkbox I want to enable the textbox and move...
1
by: dx | last post by:
I'm extremely frustrated with ASP.NET...again! To me this should be as simple as setting oCheckBox.Checked = True.. yet for some reason it isn't. I have a user control (ascx) that that has a...
4
by: Shiju Poyilil | last post by:
Hello EveryBody, I have a dropdownlist with some values as .net server controls & a button , on clicking a button i need to generate the choosen contorl dynamically. I am giving a small glimpse...
1
by: Christiaan Nieuwlaat | last post by:
Hi everyone, Could you please help me with this? I need to create a table in which resultdata from a sql server table can be shown and/or edited by using controls, for instance the radiobutton....
3
by: Nathan Sokalski | last post by:
I am using the AddHandler statement to add a CheckedChanged event handler to a series of RadioButtons that I create in a loop. However, the handler is not being called for a reason I cannot...
2
by: D Hass | last post by:
Radio Buttons are added to my form During the Load event, the quantity determined by User input. They are placed in pairs on groupboxes with code like this: (edited a bit for brevity) Public...
3
by: Mike P | last post by:
I am working with some code where a number of contacts are taken from a table and then added to a page with a radio button to the right of each one where the name of each radio button has the...
2
by: robert112 | last post by:
This is quite a hard one guys. ***Some necessary back ground Info*** I have an asp.net 1.1 application that uses a WYSIWYG to return some html created by the user in the admin section of the...
2
by: =?Utf-8?B?Unlhbg==?= | last post by:
I have created a form frmData without any controls in it. Then I created a main form frmMain; added a button btnOpenFormData and added code in button click event to add radio button acontrol...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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...

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.