Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error while deploying web part

Status
Not open for further replies.

Zoom1234

Programmer
Oct 30, 2003
116
BE
Hi,
I am creating my first web part.
Below is the code in my .cs file.
Code:
protected override void RenderWebPart(HtmlTextWriter output)
   {
      output.Write(SPEncode.HtmlEncode(Text));
      //Create a Lable
      Label myLabel = new Label();
      //Write the Text
      myLabel.Text = "Hello World";      
      //Add the lable control to the page
      this.Controls.Add(myLabel);
      //Render the Html output
      myLabel.RenderControl(output);               
   }
The web part gets uploaded successully, but while importing the web part i am getting error page with message : The "WebPart1" Web Part appears to be causing a problem".
Not sure what does that mean.
Can someone explain me how to overcome this error?

TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top