Copied to clipboard

Flag this post as spam?

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


  • tony 15 posts 35 karma points
    Oct 20, 2010 @ 00:35
    tony
    0

    .Net User Controls

    Hi all,

    My dev system is..  Umbraco 4.0.2.1, VS2.5

    I have created a user control (*.ascx) file, its very simple just to test my theory before creating the entire form.  It is simply 2 different aspx:Text box (firstname and surname), a button and some code that emails the information entered to the client (I tried Contour but I couldnt skin it as the client wants it - probably my CSS limitation).

    The ascx looks like so...

     

    Having copied the DLL and ascx file, I created a macro - that just references the control...

     

     

    I then insert the macro into my content and it renders it exactly as I'd expect...

     

     

    Then something unexpected happens (at least unexpected to me), when I save it... the aspx:text boxes and button disapear.  If I view the HTML thay are also missing from it...  Clearly when I view it then, there are two labels but no fields or buttons.

     

    I cant work out why my fields disappear.  Any pointers?

     

    Many thanks in advance

     

    Tony

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 20, 2010 @ 02:36
    Aaron Powell
    0

    It's probably just to do with the macro rendering in the WYSIWYG editor. That is very limited in how it works as it has to run in-proc to generate the HTML to return.

    I turn off the WYSIWYG editor rendering of macros because:

    • It'll reduce overhead of loading the WYSIWYG
    • It doesn't give editors a false impression that they can interact with the macro from the backoffice
    Does it work fine on the published page?

  • Sebastiaan Janssen 5045 posts 15478 karma points MVP admin hq
    Oct 20, 2010 @ 08:47
    Sebastiaan Janssen
    0

    Also, you don't have to insert into the rich text editor, you can also use macro's in your templates (master page), unless you really need editors to be able to insert the form at some pages.

  • Richard Soeteman 4036 posts 12864 karma points MVP
    Oct 20, 2010 @ 08:49
    Richard Soeteman
    0

    HI Tony,

    +1 for @slace his comments, you better use the MacroContainer picker in 4.5.2, but since you are on 4.0.2.1 You can use the MacroPicker package I wrote ages ago so you don't need to use the macro functionality in the WYSIWYG edito.

    Cheers,

    Richard

  • tony 15 posts 35 karma points
    Oct 20, 2010 @ 08:50
    tony
    0

    Slace - You got it!  Turning the rendering off fixed it.  Many thanks.

    Sebastian - Good point and I guess it makes it less likely the editors will break anything

     

    Thanks Umbraco world

     

    Tony

Please Sign in or register to post replies

Write your reply to:

Draft