|
-
Jul 26th, 2005, 02:20 PM
#1
dynamic controls
I need to try to create some ASP.NET server side controls dynamically at runtime. I know I can do this using placeholder controls, but what I am doing is writing out an html table via code. In one of the fields in this HTML table will be checkboxes. I want them to be ASP.NET checkboxes so I can use them in the codebehind.
Since the amount of records written out to this table is dynamic, infact the entire table is dynamic, there is no way for me to put placeholders and design time.
what method can I use to accomplish this?
-
Jul 27th, 2005, 03:49 AM
#2
Frenzied Member
Re: dynamic controls
If you are creating the HTML table programmically then you can add the new control to the ControlCollection for the TableCell.
Code:
TableCell contextCell = new TableCell();
contextCell.Width = 24;
Image contextImage = new Image();
contextImage.ImageUrl = "/images/explore.gif";
contextCell.Controls.Add( contextImage );
Give a shout if you have any problems.
DJ
If I have been helpful please rate my post. If I haven't tell me!
-
Jul 27th, 2005, 04:22 AM
#3
Re: dynamic controls
What about a repeater control? It can be surrounded by your table tags and can repeat for whatever amount of times for your checkboxes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|