Hi,
I am creating my first web part.
Below is the code in my .cs file.
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
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);
}
Not sure what does that mean.
Can someone explain me how to overcome this error?
TIA