Copied to clipboard

Flag this post as spam?

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


  • aits 15 posts 46 karma points
    Oct 12, 2015 @ 08:58
    aits
    0

    Action of surfaceController not hitting

    Hi, I have used multi site with single installation using two content root folder and having different domain/hostname in different folder. So i can access both sites with different template using different url. This is working fine.

    Now, I have form where user can fill(on both site). when user submits it saved successfully from both site and a confirmation link is sent to user(works on both site). I am using controller to do accept the form.

    And confirmation link is sent to email, now when user clicks on link this needs to be handled by another controller, Now the culprit shows here, when I do it using one domain(url) then it executes successfully but when using another url it doesn't go to the action required. Surprisingly the controller constructor is called and also the overrided index method is also called but another method is not executed.

    my surfaceController is as:

    public class SampleResultContentController : RenderMvcController
    {
            private static readonly ILog Logger =
            LogManager.GetLogger(
                MethodBase.GetCurrentMethod().DeclaringType
            );
    
        public SampleResultContentController()
            : base()
        {
            Logger.Info("initializing the constructor");
    
        }
    
        public override ActionResult Index(Umbraco.Web.Models.RenderModel model)
        {
            Logger.Info("overriding the base index");
            return base.CurrentTemplate(model);
        }
    
    
        public ActionResult SampleConfirmation(RenderModel model)
        {
            Logger.Info("Executing the sample confirmation index");
        }
    }
    

    the url is "{{domain}}/sample/confirm?token=EDIE3483T7ED23"

    Any help please.

  • Charles Afford 1163 posts 1709 karma points
    Oct 12, 2015 @ 10:28
    Charles Afford
    0

    Where are you calling the controller from? When should it get hit? :) Charlie.

  • aits 15 posts 46 karma points
    Oct 12, 2015 @ 10:35
    aits
    0

    Where are you calling the controller from?

    I have document called, "SampleConfirmation" and respective two templates called, "SampleConfirmation" and "SampleConfirmationNp" where former is for normal domain (.com) and later is for (.com.np). And I have two root folder/content in content as Home and homeNP, they both have child documents as sample-> Confirm . where confirm is of type "SampleConfirmation" document and two template respectively.

    When should it get hit?

    so I when I hit abc.com/sample/confirm then the "sampleConfirmation" action is called but when i hit abc.com.np then action is not reached.

    hope this clarifies bit.

  • Charles Afford 1163 posts 1709 karma points
    Oct 12, 2015 @ 10:43
    Charles Afford
    100

    Ok that makes sense you are hijacking the templates :). So do you have two templates SampleConfirmation and SampleConfirmationNp?

    Try creating an action result called SampleConfirmationNp and see if that hits? It should do

  • aits 15 posts 46 karma points
    Oct 12, 2015 @ 10:59
    aits
    0

    thanks Charlie , that works.

    much thanks for the term hijacking, it directs me to correct documentation to get to know the detail behind the scene.

  • pat 124 posts 346 karma points
    Mar 14, 2017 @ 17:11
    pat
    0

    Hi I am noticing that Index method in my surface controller not hit, but i am using macro instead of template (because i have lots of forms to add ) I call my macro using renderpartial which is not working.

    but after load a view form it does hit submit button

    see my post here

Please Sign in or register to post replies

Write your reply to:

Draft