Copied to clipboard

Flag this post as spam?

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


  • Tom Bruce 122 posts 506 karma points
    Aug 22, 2017 @ 19:50
    Tom Bruce
    0

    Return a View from Controller

    When I return View from a controller I receive the following error; “Cannot perform runtime binding on a null reference”

     [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult SubmitApplicatForm(ApplicationViewModel model)
    {
    
        if (ModelState.IsValid)
        {
            _applicantHelper.CreateApplicant(model);
        }
    
        return View("Register");     
    }
    

    View Code

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    

    @{ Layout = "WebBase.cshtml"; }

    @{ Html.RenderAction("RenderTitleControls", "SiteLayout");} @CurrentPage.GetGridHtml("contentGrid", "bootstrap3") @{ Html.RenderAction("RenderRegister", "Member"); }

    @section ScriptsBottom {

    <script src="/scripts/jquery.validate.min.js"></script>
    <script src="/scripts/jquery.validate.unobtrusive.min.js"></script>
    <script src="/scripts/jquery.unobtrusive-ajax.js"></script>
    }

  • Tobias Klika 101 posts 570 karma points c-trib
    Aug 23, 2017 @ 08:09
    Tobias Klika
    0

    Could you please post the whole code of the controller, so we can see what it's inheriting from?

  • Tom Bruce 122 posts 506 karma points
    Aug 23, 2017 @ 09:09
    Tom Bruce
    0

    I find the answer last night, for anyone else how has the same problem. The following code worked for me.

     return RedirectToUmbracoPage(1200);
    
Please Sign in or register to post replies

Write your reply to:

Draft