Copied to clipboard

Flag this post as spam?

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


  • Ravindra 46 posts 117 karma points
    Aug 05, 2014 @ 10:10
    Ravindra
    0

    User Control not rendering data!

    Hii everyone!

    I am Ravindra..

    i have used a user control in my umbraco7...

    user control has a button and a label..by default the label visibility is false..

    on button click event i have written that label1.visible=true;

    now i created a  macro  with this user control!

    i called it in my template when i preview it button is appearing but i clicked on it no text of label is coming

    please help me!

    Regards..

    Ravindra

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 05, 2014 @ 12:56
    Jeroen Breuer
    100

    Hello,

    Umbraco 7 runs in MVC mode by default and UserControls won't work in that. Go to umbracosettings.config and change <defaultRenderingEngine>Mvc</defaultRenderingEngine> to <defaultRenderingEngine>WebForms</defaultRenderingEngine>. After that if you create a template it will be a masterpage instead of a Razor file. If you call the macro in the masterpage template inside the form tag it should work.

    However it's better to keep using MVC in Umbraco 7 instead of webforms. This blog might help: http://umbraco.com/follow-us/blog-archive/2013/7/14/moving-from-webforms-to-mvc.aspx

    Jeroen

  • Ravindra 46 posts 117 karma points
    Aug 05, 2014 @ 14:22
    Ravindra
    0

    Thank you very much jeroen!

    Regards,

    Ravindra!

     

  • Harish 15 posts 74 karma points
    Oct 01, 2015 @ 10:52
    Harish
    0

    thanks to both of you.....It worked for me.....

Please Sign in or register to post replies

Write your reply to:

Draft