Copied to clipboard

Flag this post as spam?

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


  • Alexander Klintesten 3 posts 23 karma points
    Jan 25, 2011 @ 11:18
    Alexander Klintesten
    0

    Adding eventhandler to usercontrol from masterpage

    Hi.

     

    I have this usercontrol macro sitting on my master page. From the codebehind of my masterpage I would like to register eventhandlers for a specific event. How do I do that?

    This is what I'm trying to accomplish:

    userControl1.PurchaseAccepted += new x.PurchaseAcceptedEventHandler(userControl1_PurchaseAccepted);

    When I use Page.FindControl I only get the macro object. I would instead like to get my hands on the regular .net usercontrol type that the macro represents. 

    Please Advice

    /Alex

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Jan 30, 2011 @ 21:54
    Jan Skovgaard
    0

    Hi Aleksander

    Maybe this blogpost could provide you with the solution? http://farmcode.org/post/2011/01/28/Creating-code-behind-files-for-Umbraco-templates.aspx

    /Jan

  • Daniel Bardi 924 posts 2556 karma points
    Jan 31, 2011 @ 02:09
    Daniel Bardi
    0
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies