We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Runtime control in asp.net

Thread ID:

Created:

Updated:

Platform:

Replies:

45331 Jun 17,2006 12:34 AM Sep 29,2006 09:43 AM ASP.NET Web Forms (Classic) 2
loading
Tags: FAQ
Renish
Asked On June 17, 2006 12:34 AM

how to add runtime controlswith data from a table on page load and its access

Administrator [Syncfusion]
Replied On June 17, 2006 02:53 AM

Hi Renish, I am not sure what you are trying are you just trying to create controls at runtime through code? Here is a sample code I am ataching where the control ( a textbox and a label is placed inside a panel at runtime ). You can use this code in either page_Load or Page_Init Remember because of I am using two controls I am using an another control. You can try the same in any of the controls you are in need of Control control=new Control(); TextBox textBox=new TextBox(); control.Controls.Add(textBox); Label lbl=new Label(); lbl.ForeColor=Color.Red; lbl.Text="Enter Text Here"; control.Controls.Add(lbl); this.Panel1.Controls.Add(control); Hope this helps! Regards, A.Sivakumar

Administrator [Syncfusion]
Replied On September 29, 2006 09:43 AM



>Hi Renish,
>
> I am not sure what you are trying are you just trying to create controls at runtime through code?
>
>Here is a sample code I am ataching where the control ( a textbox and a label is placed inside a panel at runtime ). You can use this code in either page_Load or Page_Init
>
>Remember because of I am using two controls I am using an another control. You can try the same in any of the controls you are in need of
>
>Control control=new Control();
>
> TextBox textBox=new TextBox();
> control.Controls.Add(textBox);
> Label lbl=new Label();
> lbl.ForeColor=Color.Red;
> lbl.Text="Enter Text Here";
> control.Controls.Add(lbl);
> this.Panel1.Controls.Add(control);
>
>Hope this helps!
>
>Regards,
>A.Sivakumar

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;