why would i get a different views when called from different controller actions in asp.net-mvc

Posted by ooo on Stack Overflow See other posts from Stack Overflow or by ooo
Published on 2010-05-20T18:20:53Z Indexed on 2010/05/20 21:40 UTC
Read the original article Hit count: 134

I have 2 different controller actions. As seen below, one calls the same view as the other one. The fitness version has a bunch of jquery ui tabs.

    public ActionResult FitnessByTab(string tab, DateTime entryDate)
    {
        return View("Fitness", GetFitnessVM(DateTime.Today.Date));
    }


    public ActionResult Fitness()
    {

        return View(GetFitnessVM(DateTime.Today.Date));
    }

    private FitnessVM GetFitnessVM(DateTime dt)
   {
        FitnessVM vm = new FitnessVM();
        vm.Date = dt;
       // a bunch of other date that comes from a database
        return vm;
    }

the issue is that on the action FitnessByTab() the tabs dont load correctly but on the Fitness() it loads fine. How could this be as my understanding is that they would be going through the same code path at that point. As you can see i am hard coded both to the same date to make sure its not a different date causing the issue.

EDIT

Issues has been solved. It was the relative referencing of all my links. I didn't get any issues until i used firebug that highlighted some missing references due to "../../" instead of Url.Content("

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about controller-actions