title: MVC BeginForm - Return three different ajax text strings from controller
body: <p>I need to send 3 variables (viewbags) to the view from the controller when data is submitted in beginform. At the moment I can only get 1 variable to post back due to the AJAX function below.</p>
  
  <p>JQUERY/AJAX</p>
  
  <pre><code>   function autosubmit() {
  
  
          $.ajax({
              type: 'POST',
              url: this.action,
              data: $('form').serialize(),
             success: function (result) {
                      $('#one').html(result); //ViewBag.one
                      $('#two').html(result); //ViewBag.two
                      $('#three').html(result); //ViewBag.three
                                       }
  
          });
  
  
      }
  </code></pre>
  
  <p>FORM:</p>
  
  <pre><code>@using (Html.BeginForm())
  {
  //form data automatically submits to controller
  }
  
  
  &lt;div id="one"&gt;ajax data&lt;/div&gt;
  &lt;div id="two"&gt;ajax data&lt;/div&gt;
  &lt;div id="three"&gt;ajax data&lt;/div&gt;
  </code></pre>
  
  <p>CONTROLLER</p>
  
  <pre><code>[HttpPost]
          public ActionResult Index(model stuff)
          {
           ViewBag.one = stuff.data1;
           ViewBag.two = stuff.data2;
           ViewBag.three = stuff.data3;
           Return(ViewBag.one, ViewBag.two,ViewBag.three)
           }
  </code></pre>