Copied to clipboard

Flag this post as spam?

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


  • Connie DeCinko 931 posts 1160 karma points
    Mar 06, 2015 @ 02:44
    Connie DeCinko
    0

    RedirectToCurrentUmbracoPage fails in SurfaceController of PartialView

    I have a form in a partial view that works almost as it should. I am able to get the data from the form and update the database via a SurfaceController. My final step is to reload the Umbraco page.

    I've tried

     return RedirectToCurrentUmbracoPage();
    

    but it results in this error:

    Cannot find the Umbraco route definition in the route values, the request must be made in the context of an Umbraco request
    

    I can however redirect to a specific page but that means hard coding the page id:

    return RedirectToUmbracoPage(2097);
    

    How can I get the id of the current page or cause the page to reload correctly?

  • Yakov Lebski 591 posts 2347 karma points
    Mar 06, 2015 @ 07:14
    Yakov Lebski
    0

    What version of Umbraco you are using? Are you using Ajax post ?

  • Connie DeCinko 931 posts 1160 karma points
    Mar 06, 2015 @ 15:51
    Connie DeCinko
    0

    Umbraco 6.1.6

    Doing a standard form submit.

    @using (Html.BeginUmbracoForm("editOpinion", "OpinionsSurface", null, new Dictionary<string, object> { { "class", "form-horizontal" }, { "role", "form" } }))
    
  • Yakov Lebski 591 posts 2347 karma points
    Mar 07, 2015 @ 08:32
    Yakov Lebski
    0

    please verify that you global.asax file inherits from umbraco app, default.aspx is umbraco file and inherits from umbraco.UmbracoDefault. in your web.config UrlRewriteModule and UmbracoModule is first modules in httpmodules sections.

    Do you run web site from IIS or IIS express or from Visual Studion host ?

  • Connie DeCinko 931 posts 1160 karma points
    Mar 10, 2015 @ 23:24
    Connie DeCinko
    0
    <%@ Application Codebehind="Global.asax.cs" Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %>
    
    <%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="True" Inherits="umbraco.UmbracoDefault" trace="true" validateRequest="false" %>
    

    web.config confirmed

    IIS

    Cannot find the Umbraco route definition in the route values, the request must be made in the context of an Umbraco request 
    
Please Sign in or register to post replies

Write your reply to:

Draft