@David, @Dragoljub Ilic
I check with the code and event log, But I can't find any error. Using the ASPX Blank web template this custom webpart working fine. But when I checked with my portal engine webtemplate site button click event not trigger.
Please review below my code
Helloworld.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HelloWorld.ascx.cs" CodeFile="~/CMSWebParts/MyWebParts/HelloWorld.ascx.cs" Inherits="CMSApp.CMSWebParts.MyWebParts.CMSWebParts_MyWebParts_HelloWorld" %>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
<asp:Label ID="Label1" runat="server" Text="Label" />
Helloworld.ascx.cs
public partial class CMSWebParts_MyWebParts_HelloWorld : CMSAbstractWebPart
{
protected void Page_Load(object sender, EventArgs e)
{
Button1.Text = DataHelper.GetNotEmpty(GetValue("ButtonText"), "Show time");
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
Label1.Visible = true;
}
}