title: How to call an Action from a helper and avoid the render?
body: <p>I'm working on ASP.NE MVC4 and I'm using LungoJS library for the development.</p>
  
  <p>I'm developing a Helper to render LungoJS controls in the way I need.</p>
  
  <p>For the Select inputs, I want to get a JSON that contains the data for each option.</p>
  
  <p>I can get the needed JSON from an Action of a existing Controller.</p>
  
  <p>But when I call the action from the helper, the view renders my html inside a <code>&lt;pre&gt;</code> tag :-(</p>
  
  <p>View</p>
  
  <pre><code>    &lt;div class="form" id="address-data"&gt;
  
          @Html.LungoInputFor(m =&gt; m.CaseServiceCaseModel.CaseAddressModel.AddressDataModel.TerritoryId, "text", @Labels.Territory, @htmlAttributesRO, true)
          @Html.LungoSelectFor(m =&gt; m.CaseServiceCaseModel.CaseAddressModel.AddressDataModel.TerritoryId, @Labels.Territory, null, true, "GetTerritoryKendo", "Address")
  </code></pre>
  
  <p>Helper</p>
  
  <pre><code>    public static MvcHtmlString LungoSelectFor&lt;TModel, TValue&gt;(this HtmlHelper&lt;TModel&gt; html, Expression&lt;Func&lt;TModel, TValue&gt;&gt; expression, string label = "", object htmlAttributes = null, bool fieldset = false, string action = "", string controller = "")
      {
          TagBuilder tag = new TagBuilder("select");
          JavaScriptSerializer js = new JavaScriptSerializer();
  
          MvcHtmlString data = ChildActionExtensions.Action(html, action, controller);
          object[] json = js.Deserialize&lt;object[]&gt;(data.ToString());
  
          foreach (Dictionary&lt;string,object&gt; item in json)
          {
              foreach (var property in item)
              {
                  TagBuilder option = new TagBuilder("option");
                  switch (property.Key)
                  {
                      case "Selected":
                          if ((bool)property.Value)
                          {
                              option.MergeAttribute("selected","selected");
                          }
                          break;
                      case "Text":
                          option.InnerHtml = property.Value.ToString();
                          break;
                      case "Value":
                          option.MergeAttribute("value", property.Value.ToString());
                          break;
                      default:
                          break;
                  }
                  tag.InnerHtml += option.ToString(TagRenderMode.Normal);
              }
          }
  
          return MvcHtmlString.Create(tag.ToString(TagRenderMode.Normal));   
      }
  </code></pre>
  
  <p>I don't understand why if I'm getting the htmlstring from the Action in a variable, and after I return only the Select input html, affects the whole page... If I comment <code>ChildActionExtensions.Action(html, action, controller)</code> the view renders good (but without the content I need...)</p>