SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a stock chart and some other controls in my SharePoint WebPart...

I am unable to call all the controls in the WebPart, only one control displayed in the WebPart or the ASP server controls rendered as a object. For example Label control is rendered as System.Web.UI.WebControls.Label but the actual Label control is not displaying.

Please give me the approach to overcome this problem.

Thanks, Bhanu

share|improve this question
Are you able to post some source code tohelp us identify your issue? My bet is that you've not added the Label control to the this.Controls collection. – James Love Feb 22 '11 at 14:05

Within your CreateChildControls(), it should have something like this:

Label x = new Label();
x.Text = "hello world";
share|improve this answer

What Andrew said, an in addition you could also add them to another panel to gain some div layout control:

Label x = new Label();
x.Text = "hello world";

Label y = new Label();
y.Text = "hello world2";

Panel panel = new Panel();
panel.CssClass = "my-panel";


This is all going from memory, so you might need to tweak a couple things.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.