Page_Load and _Click events not firing in user control
We are transitioning our website to Umbraco, so right now we are playing around with using .Net user controls to add some business specific functionality. Right now I have a very basic user control:
TestControl.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestControl.ascx.cs" Inherits="UmbracoUserControls.TestControl" %> <asp:Panel ID="Questions" runat="server">
I've uploaded the .ascx to the usercontrol directory, UmbracoUserControls.dll to the bin directory, created the macro that points to the usercontrol. I used the macro button to add the Macro into a RichTextEditor on one of our pages. The content from the user control displays properly, but neither the Page_Load or the btn_Calculate_Click events fire. I've noticed one other thread on the forum describing similar issues, but it stopped before a resolution was posted. http://our.umbraco.org/forum/core/general/5341-Net-user-control-button-click-events-not-working
Any guidance would be greatly appreciated as I'm kinda scratching my head right now.
This is a longshot, but I saw this in a site where there was an asp:LinkButton in another control on the site. The linkbutton cause the form to render differently because it needed the postback javascript. When I removed the linkbutton, the events started working again.
Another thing that might be wrong is if you are rendering your RTE text through an xslt macro? This will actually render the ascx file as you describe, but not register it as a control.
Thanks for your help guys. The company we had develop the initial site has a weird way of handling pages with user controls, so they actually have a different template needed for those pages.
I faced similar problem. See this http://bit.ly/bPfxG8 for complete details. The link button if used under Umbraco will case ASP.NET event model to misbehave.
Page_Load and _Click events not firing in user control
We are transitioning our website to Umbraco, so right now we are playing around with using .Net user controls to add some business specific functionality. Right now I have a very basic user control:
TestControl.ascx
TestControl.ascx.cs
I've uploaded the .ascx to the usercontrol directory, UmbracoUserControls.dll to the bin directory, created the macro that points to the usercontrol. I used the macro button to add the Macro into a RichTextEditor on one of our pages. The content from the user control displays properly, but neither the Page_Load or the btn_Calculate_Click events fire. I've noticed one other thread on the forum describing similar issues, but it stopped before a resolution was posted. http://our.umbraco.org/forum/core/general/5341-Net-user-control-button-click-events-not-working
Any guidance would be greatly appreciated as I'm kinda scratching my head right now.
This is a longshot, but I saw this in a site where there was an asp:LinkButton in another control on the site. The linkbutton cause the form to render differently because it needed the postback javascript. When I removed the linkbutton, the events started working again.
Another thing that might be wrong is if you are rendering your RTE text through an xslt macro? This will actually render the ascx file as you describe, but not register it as a control.
Did you try to include the usercontrol in a template with the ASP.NET way of using usercontrols? I mean with the <%@ Register %> directive?
Thanks for your help guys. The company we had develop the initial site has a weird way of handling pages with user controls, so they actually have a different template needed for those pages.
I faced similar problem. See this http://bit.ly/bPfxG8 for complete details. The link button if used under Umbraco will case ASP.NET event model to misbehave.
Tarek.
is working on a reply...