title: how can i set layout to null in action filter?
body: <p>Is it posible to set the layout to null in action filter? For example</p>
  
  <pre><code>public ActionResult SomeAction()
      {
          return PartialView();
      }
  </code></pre>
  
  <p>I want to render some action with </p>
  
  <pre><code>@Html.Action("someaction")
  </code></pre>
  
  <p>it works for now. </p>
  
  <p>But i want to use this action in 2 modes : like child and like master for different situations. I can set Layout to null in view for this</p>
  
  <p>view:</p>
  
  <pre><code>@{
     if(condtition)
     {
          Layout = null;
     }
  }
  </code></pre>
  
  <p>But i want to find more elegant way :)</p>
  
  <p>Like:</p>
  
  <p>action without partial</p>
  
  <pre><code>public ActionResult SomeAction()
          {
              return View();
          }
  </code></pre>
  
  <p>and in filter set the layout to null if action is child</p>
  
  <pre><code> public class LayoutFilter : ActionFilterAttribute
      {
          public override void OnActionExecuting(ActionExecutingContext filterContext)
          {
             if(filterContext.IsChildAction)
             {
                 //set the layout to NULL here!
  
             }
          }
      }
  </code></pre>
  
  <p>It is posible? Any ideas?</p>