Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • ffz 5 posts 25 karma points
    Apr 12, 2012 @ 18:05
    ffz
    0

    no "OnClick" events fire on Macro UserControls that are running on pages under the root

    Hi there,

    I've got a super strange behavior. I've worked with Umbraco before and never had such a crazy problem! And I think I’m doing something wrong.

     

    I have a basic (4.7.1.1) installation (no starter kit). Works fine so far.

     

    I have created a few templates. 

    Master.master
      Home.master
      Login.master

    Also I’ve some Macros as UserControls (no caching!)

    - Header
    - Footer
    - Login

    In the Master.master file I use the Header and Footer Macro.

    On the Home.master and on the Macro.master I use the Login Macro

    I have let say two document Types

    - Home
    - Login

    My site structure on Conten looks like this

    Home (Home Template) [Root]
      Login (Login Template) [login.aspx]
      ...

    Now when I click a button that is within the Login Macro and I’m on the root (Home) I get the button OnCklick event fired in the UserControls code behind. But when I get on the login.aspx the same event won’t work anymore.

    That’s the first Issue. I can somehow solve this issue by removing the Header and Footer Macros used on the Master.master

    I use this code to include the Macro:

    On the Master.master:

    <asp:Content ID="Content1"
    ContentPlaceHolderID="ContentPlaceHolderDefault"
    runat="server">
    <umbraco:Macro Alias="Header" runat="server" />
    <asp:ContentPlaceHolder ID="ContentPlaceHolderMain" runat="server"></asp:ContentPlaceHolder>
    <umbraco:Macro Alias="Footer" runat="server" />

     

     

    And on the Login.master  (Home.master looks the same):

    <%@ Master Language="C#"
    MasterPageFile="~/masterpages/Master.master"
    AutoEventWireup="True" %>
    <asp:content ContentPlaceHolderId="ContentPlaceHolderMain" runat="server">
                    <umbraco:Macro Alias="Login" runat="server"></umbraco:Macro>
    </asp:content>

    I When I remove the two Macros (Header and Footer) from the Master.master it works. That’s what I can’t explain. Did I’ve screwed here some naming convention?

    I’ve build similar master page structures using Macros on a root master and child master templates before. And I’ve never had such a problem.

    I just tried the same with an earlier version (4.7) but same problem.

    Did someone ever have a similar problem?

    I’m sure I’m doing something wrong here...

     

    Anyway I’m getting crazy here. Hope someone experienced the same a can give me an advice!!!

     

    Thnaks

Please Sign in or register to post replies

Write your reply to:

Draft