title: MVC3 Partial View - Can the DIV be inside the Ajax.BeginForm?
body: <p>This is what i need to do:</p>
  
  <p>I have a Partial View (PV):  </p>
  
  <pre><code>    @if (Convert.ToBoolean(ViewData["IsLogged"].ToString())) 
      {
          &lt;div id="onlineStatus"&gt;
              ONLINE &gt;&gt;
              @Html.ActionLink("Take a Break", "GoOffline", "Account")
          &lt;/div&gt;
      } 
      else 
      {
          &lt;div id="offlineStatus"&gt;
             IN A BREAK &gt;&gt;
              @Html.ActionLink("Go Online", "GoOnline", "Account")
          &lt;/div&gt;
      }
  </code></pre>
  
  <p>I put this PV on the *_layout.cshtml* so anytime i click on the <strong>ActionLink</strong>, the page should stay the same and the PV should only redraw itself in an asynchronous way.  </p>
  
  <p>I'm reading about using <strong>Ajax.BeginForm</strong> and it seems it needs a <strong></strong> but my question is:<br>
  Q1: Shall I put the <strong></strong> inside the <strong>Ajax.BeginForm</strong> ?? </p>
  
  <pre><code>@using (Ajax.BeginForm(new AjaxOptions {  
             UpdateTargetId="divStatus", 
              InsertionMode=InsertionMode.Replace }))  {    
  &lt;div id="divStatus"&gt;  
      @if (Convert.ToBoolean(ViewData["IsLogged"].ToString()))  
      {  
          &lt;div id="onlineStatus"&gt;  
              ONLINE &gt;&gt;  
              @Html.ActionLink("Take a Break", "GoOffline", "Account")  
          &lt;/div&gt;  
      }  
      else  
      {  
          &lt;div id="offlineStatus"&gt;  
             IN A BREAK &gt;&gt;  
              @Html.ActionLink("Go Online", "GoOnline", "Account")  
          &lt;/div&gt;  
      }  
  &lt;/div&gt;  
  }  
  </code></pre>
  
  <p>CONTROLLER ...to return itself?</p>
  
  <pre><code>    public ActionResult GoOffline()
      {
          GoOffline();
          ViewData["IsLogged"] = "False";
          return PartialView("_OnlineStatusCtrl");
      }
  </code></pre>
  
  <p>PROBLEM:<br>
  The entire page redraws as the PV so I guess it is NOT drawing itself inside the <strong></strong>  </p>
  
  <p>Is the problem how i call the <strong>Ajax.Beginform</strong> ?<br>
  Is the problem that I put the <strong></strong> inside the <strong>Ajax.BeginForm</strong> ?<br>
  Is the problem that I should put the <strong>Ajax.BeginForm</strong> on the <strong>_layout.cshtml</strong> instead?  </p>
  
  <p>...is it's just that I simply still don't understand MVC ??</p>
  
  <p>:--)  </p>