I have 3 Webpart namely WebPart-1.dwp, Webpart-2.dwp and WebPart-3.dwp.
I have the following scenario:
WebPart-1 : WebPart-2 (Inheritance)
WebPart-2 : WebPArt-3 (Inheritance)
WebPart-3 : Microsoft.SharePoint.WebPartPages.WebPart (Inheritance)
If I load WebPart-1, all the web parts gets loaded correctly but the click event of the button on the WebPart-3 doesn't get fired.
My WebPart-3 code looks like:
protected override void CreateChildControls()
{
base.CreateChildControls();
m_MessageLabel = new Label();
m_MessageLabel.ID = "m_MessageLabel";
m_MessageLabel.Text = "Updated the settings successfully. You can now close this WebPart.";
m_MessageLabel.Visible = false;
m_UpdateButton = new Button();
m_UpdateButton.ID = "m_UpdateButton";
m_UpdateButton.Text = "Update";
m_UpdateButton.CausesValidation = true;
m_UpdateButton.ValidationGroup = ValidationGroup;
m_UpdateButton.Click += new EventHandler(m_UpdateButton_Click);
}
void m_UpdateButton_Click(object sender, EventArgs e)
{
//Some code here
}
protected override void RenderWebPart(HtmlTextWriter output)
{
base.RenderWebPart(output);
m_MessageLabel .RenderControl(output);
m_UpdateButton.RenderControl(output);
}
Any help on this would be greatly appreciable.