IT Community - Software Programming, Web Development and Technical Support

How to add controls into the page dynamicaly

This is a discussion on How to add controls into the page dynamicaly within the ASP and ASP.NET Programming forums, part of the Web Development category; How to add controls into the page dynamicaly...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-23-2007, 07:38 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Question How to add controls into the page dynamicaly

How to add controls into the page dynamicaly
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-23-2007, 07:39 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: How to add controls into the page dynamicaly

controlCount = dim.Count;
ctrltxtBox = new TextBox[controlCount];
ctrllabel = new Label[controlCount];

int x = 150;
for (int i = 0; i < ctrltxtBox.Length; i++)
{
ctrltxtBox[i] = new TextBox();
ctrllabel[i] = new Label();
ctrllabel[i].Text = (string)dim[i];
ctrltxtBox[i].Name = (string)dim[i];
ctrltxtBox[i].Location = new Point(160, x);
ctrllabel[i].Location = new Point(26, x);
x = x + 30;
this.Controls.Add(ctrltxtBox[i]);
this.Controls.Add(ctrllabel[i]);
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Data Controls Venkat ASP and ASP.NET Programming 133 10-11-2008 08:41 PM
How can we Dynamically create web controls Kirubhananth ASP and ASP.NET Programming 3 03-14-2008 10:00 PM
'Page' ia an unambiguous reference between 'System.Web.UI.Page' and 'Project1.Page' poornima ASP and ASP.NET Programming 1 03-05-2008 03:12 AM
WebParts controls S.Vinothkumar ASP and ASP.NET Programming 5 11-16-2007 03:06 AM
Asp.net controls not supported by Ajax? Gopisoft ASP and ASP.NET Programming 0 07-17-2007 12:22 AM


All times are GMT -7. The time now is 08:18 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0