Copied to clipboard

Flag this post as spam?

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


  • Peter S 169 posts 587 karma points
    Jan 19, 2015 @ 10:20
    Peter S
    0

    Macro form sends null values

    I added a form based off a model in a macro partial view. It renders and fires fine but the values are all null in the surfacecontroller. Why is this? The code is copied from a partial view and the error only occurs while used in a macro. I'm in 7.1.8.

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @{
        var nl = new NewsletterModel();
    }
    
    @using (Ajax.BeginForm("NewsletterSignup", "Newsletter", new AjaxOptions
    {
        ...
    }))
    {
        @Html.AntiForgeryToken()
    
        @Html.LabelFor(model => nl.Email)
        @Html.TextBoxFor(model => nl.Email)
        <input type="submit" />
    }
  • Peter S 169 posts 587 karma points
    Jan 19, 2015 @ 10:54
    Peter S
    0

    It works fine if I add the form via a partial view inside the macro. Is this a limitation to the macro views or have I just made something wrong in the markup?

Please Sign in or register to post replies

Write your reply to:

Draft