Click event on Custom control not firing
Hi
Just realized that this may have been more appropriate for the Developing with Sitefinity forum so please move if that forum is more appropriate.
I have created a custom control using Sitefinity Thunder. We are using custom controls rather than user controls because we are getting a published Sitefinity website.
It has created the .ascx, .cs and designer files as expected. I have added an ASP Button server control to the .ascx and referenced it in the .cs in the same manner as the Message Label example (except its a button).
In InitializeControls I add the click event handler (see attached).
The problem that I am having is that the click event does not fire. I have looked at the examples on the Sitefinity website but they seem to successfully avoid this topic.
Any comments appreciated?
Thanks Peter
protected override void InitializeControls(GenericContainer container)
Label messageLabel = this.MessageLabel;
if (string.IsNullOrEmpty(this.Message))
messageLabel.Text = "Hello, World!";
else
messageLabel.Text = this.Message;
this.nextBtn = NextButton;
this.nextBtn.Click += new EventHandler(nextBtn_Click);
void nextBtn_Click(object sender, EventArgs e)
throw new NotImplementedException();
Hi Peter,
Can you try by enabling the ViewState of the page where the control is located? (going to the page's Actions->Title & Properties -> Advanced Options -> Enable ViewState)
Best Regards,
Junior Dominguez
Telerik