Copied to clipboard

Flag this post as spam?

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


  • z4kk 24 posts 83 karma points
    Apr 12, 2016 @ 12:47
    z4kk
    0

    Change Template from controller

    Hi!

    It's is possible to change template of rendered page by condition in hijacked controller?

    For example, I have doctype "Profile" with two templates - "ProfileTpl" and "PofileExtendedTpl"

    I need to change template in Index action, like this:

       public override ActionResult Index(RenderModel model, bool? ext)
        {
            if (ext.HasValue && ext == true)
                return NotCurrentTemplate("PofileExtendedTpl", model);
    
            return base.Index(model);
        }
    

    Thanks!

  • z4kk 24 posts 83 karma points
    Apr 12, 2016 @ 15:18
    z4kk
    0

    Ok. I Just found that, I can simple use return View("PofileExtendedTpl")

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Apr 12, 2016 @ 15:26
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies