Copied to clipboard

Flag this post as spam?

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


  • Thomas Petersen 3 posts 33 karma points
    Dec 03, 2013 @ 17:01
    Thomas Petersen
    0

    Umbraco 7 usercontrol

    Hi everyone

    Currently implementing a website using Umbraco 7. I have a Usercontrol containing a three textboxes and a submitbutton (a simple contactform).

    When I place the generated Macro onto a page and then want to test it, it fails when it reaches the first textbox.

    Any ideas?

    Code on ascx:

        <div class="input-error">
            <asp:Literal ID="Literal1" runat="server"></asp:Literal></div>
        <div class="input-label">Name</div>
        <div class="input-holder">
            <asp:TextBox ID="TextBox1" CssClass="textinput" runat="server"></asp:TextBox>
        </div>
        <div class="input-label">Email</div>
        <div class="input-holder">
            <asp:TextBox ID="TextBox2" CssClass="textinput" runat="server"></asp:TextBox>
        </div>
        <div class="input-label">Message</div>
        <div class="input-holder">
            <asp:TextBox ID="TextBox3" TextMode="MultiLine" CssClass="textmultiinput" runat="server"></asp:TextBox>
        </div>
        <div class="input-button">
            <asp:Button ID="Button1" runat="server" CssClass="inputbutton" Text="Send" />
        </div>

    Codebehind is not doing anything, I just want to see the textboxes before I move on.

  • Vincent Baaij 95 posts 344 karma points c-trib
    Dec 03, 2013 @ 17:26
    Vincent Baaij
    100

    Thomas,

    Umbraco 7 sets the default render engine to MVC. If you want to use usercontrols I think you have to set te render engine to use webforms.

    You can change the setting in config/umbracosettings.config:

     <templates>
        <defaultRenderingEngine>Webforms</defaultRenderingEngine>
      </templates>
  • Thomas Petersen 3 posts 33 karma points
    Dec 03, 2013 @ 18:11
    Thomas Petersen
    0

    Nope, that didn't change anything, Any other ideas?

  • Vincent Baaij 95 posts 344 karma points c-trib
    Dec 03, 2013 @ 21:13
    Vincent Baaij
    0

    Can you post what the template and macro looks like?

  • Thomas Petersen 3 posts 33 karma points
    Dec 03, 2013 @ 22:06
    Thomas Petersen
    0

    OK, i got it working. I added <form runat="server">, had tried that before, but this time around it worked.... :/ Have no idea why i didn't work before, but there you go.

     

    Thanks for the help, it might be a combination of your help and the added form tag that did the trick.

  • 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