Copied to clipboard

Flag this post as spam?

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


  • M 33 posts 91 karma points
    Feb 08, 2013 @ 07:11
    M
    0

    Question: Field validations inside user control render when a page is loaded

    I'm adding a .Net user control in a template like this: (note, I've also tried adding in RTE - but that has its own issue)

    @Html.Raw(umbraco.library.RenderMacroContent("<?UMBRACO_MACRO macroAlias=\"ContestInputForm\"></?UMBRACO_MACRO>"Model.Id));

    The user control contains required field validators, that should appear only on a button click. That behavior works fine when the form is run from visual studio. However when used within umbraco, it shows validation errors the first time macro is rendered on the page. 

    Below is how the validator is added in .ascx form

    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtName" Display="Dynamic" ErrorMessage="Your name is required" Font-Size="11px" ForeColor="Red" SetFocusOnError="True"></asp:RequiredFieldValidator>

    Is there a way to fix this? 

    Screen shot (when macro is used within umbraco):

     

  • M 33 posts 91 karma points
    Feb 08, 2013 @ 12:08
    M
    0

    Btw: I am on umbraco v 4.7.0 (Assembly version: 1.0.4090.21631)

Please Sign in or register to post replies

Write your reply to:

Draft