title: Child actions are not allowed to perform redirect actions, after setting the site on HTTPS
body: <p>I am getting the error below:</p>
  
  <pre><code>Child actions are not allowed to perform redirect actions.
  
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  
  Exception Details: System.InvalidOperationException: Child actions are not allowed to perform redirect actions.
  
  Source Error:
  
      Line 1:  &lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;RenderActionViewModel&gt;" %&gt;
      Line 2:  &lt;%Html.RenderAction(Model.ActionName, Model.ControllerName, Model.RouteValues); %&gt;
      Line 3: 
  
  
  
  The Stack trace is:
  
      [InvalidOperationException: Child actions are not allowed to perform redirect actions.]
  
  
      System.Web.Mvc.RedirectResult.ExecuteResult(ControllerContext context) +700064
         System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +727764
         System.Web.Mvc.Controller.ExecuteCore() +159
         System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +334
         System.Web.Mvc.&lt;&gt;c__DisplayClassb.&lt;BeginProcessRequest&gt;b__5() +62
         System.Web.Mvc.Async.&lt;&gt;c__DisplayClass1.&lt;MakeVoidDelegate&gt;b__0() +15
         System.Web.Mvc.&lt;&gt;c__DisplayClasse.&lt;EndProcessRequest&gt;b__d() +52
         System.Web.Mvc.&lt;&gt;c__DisplayClass4.&lt;Wrap&gt;b__3() +15
         System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +41
         System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1411
  
      [HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.]
         System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +2819
         System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +275
         System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +94
         System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +828
         System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +56
         ASP.views_shared_renderaction_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\TFS\PEEP\Src\Main\Hosts\BCA.PEEP.WebSite\Views\Shared\RenderAction.ascx:2
         System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +131
         System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
         System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +12742749
         System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
         System.Web.UI.Page.Render(HtmlTextWriter writer) +40
         System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +65
         System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
         System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +12742749
         System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5363
  </code></pre>
  
  <p>The RenderAction.ascx code where i get the error at line 2 is:</p>
  
  <pre><code>    &lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;RenderActionViewModel&gt;" %&gt;
      &lt;%Html.RenderAction(Model.ActionName, Model.ControllerName, Model.RouteValues); %&gt;
  </code></pre>
  
  <p>And the Action in the controller is:</p>
  
  <pre><code>public ViewResult DashboardQuicksearch(UserFilter userFilter, bool? showAdvancedSearchLink)
          {
              int resultCount;
              List&lt;KeyInfo&lt;string&gt;&gt; makeList = quickSearchProvider.GetKeysForCriteriaKey(SearchType.Vehicle, "MakeName", userFilter, "null", false, null, out resultCount);
  
              var selectListItems = new List&lt;SelectListItem&gt;();
              foreach (KeyInfo&lt;string&gt; item in makeList)
              {
                  selectListItems.Add(new SelectListItem() { Text = item.Key, Value = item.Key, Selected = false });
              }
  
              var viewModel = new DashboardQuicksearchViewModel() {
                  MakeList = (makeList.Count == 1)
                      ? new SelectList(selectListItems, "Value", "Text", selectListItems[0].Value)
                      : new SelectList(selectListItems, "Value", "Text"),
                  VehicleCount = quickSearchProvider.GetLotItemCount("null", userFilter),
                  ShowAdvancedSearchLink = (showAdvancedSearchLink.HasValue ? showAdvancedSearchLink.Value : false)
              };
  
              return View(Constants.Views.Search.DashboardQuicksearch, viewModel);
          }
  </code></pre>
  
  <p>I have absolutely no idea how to fix it.</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>This is the DashboardQuickSearch.ascx</p>
  
  <pre><code>&lt;%@ Control Language="C#" Inherits="BCA.PEEP.Web.UI.ViewUserControlBase&lt;DashboardQuicksearchViewModel&gt;" %&gt;
  &lt;%@ Import Namespace="BCA.PEEP.Web.Mvc" %&gt;
  
  
  &lt;div class="Makes"&gt;
  &lt;%:(Model.MakeList.Count() == 1 
      ? Html.DropDownList("Makes", Model.MakeList, new {@class="search-select"})
      : Html.DropDownList("Makes", Model.MakeList, Html.Text("Name of search results filter:SelectMake"), new {@class="search-select"})
      ) %&gt;
  &lt;/div&gt;
  &lt;div class="Models"&gt;&lt;%:Html.DropDownList("Models", new List&lt;SelectListItem&gt;(), Html.Text("Name of search results filter:SelectModel"), new { disabled = "disabled", @class="search-select"})%&gt;&lt;/div&gt;
  &lt;div class="ResultAndAction"&gt;
      &lt;span id="VehicleCount" class="VehicleCount"&gt;&lt;span class="count-number"&gt;&lt;%:Model.VehicleCount.ToString("N0") %&gt;&lt;/span&gt; &lt;%: Html.Text(Model.VehicleCount, "SearchResultsLabels:Vehicles singular", "SearchResultsLabels:Vehicles plural")%&gt;&lt;/span&gt;
      &lt;div id="QSButtonDiv" class="Button"&gt;
          &lt;input id="QSButton" type="button" value ="&lt;%:Html.Text("Text on buttons:search")%&gt;" onclick="ExecuteSearch()" disabled="disabled" /&gt;
      &lt;/div&gt;
  &lt;% if (Model.ShowAdvancedSearchLink) { %&gt;
      &lt;div id="ASButtonDiv" class="Button Hidden"&gt;
          &lt;input id="ASButton" type="button" value ="&lt;%:Html.Text("Text on links:AdvancedSearch")%&gt;" onclick="AdvancedSearch()" /&gt;
      &lt;/div&gt;
  &lt;% } %&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          var vehiclesSingular = '&lt;%=Html.Text("SearchResultsLabels:Vehicles singular")%&gt;';
          var vehiclesPlural = '&lt;%=Html.Text("SearchResultsLabels:Vehicles plural")%&gt;';
          var makeCount = '&lt;%=Model.MakeList.Count().ToString("N0") %&gt;';
  
          $('#Makes').change(function () { PopulateModels(); });
          $('#Models').change(function () { UpdateVehicleCount(); });
          $('#Makes').trigger('change');
  
          function PopulateModels() {
              var make = $('#Makes').val();
              var $models = $('#Models');
              $models.append('&lt;option value="" selected&gt;' + '&lt;%=Html.Text("Name of search results filter:SelectModel") %&gt;' + '&lt;/option&gt;');
              //alert("Populate Models - Make = '" + make + "'");
              if (make == '') {
                  $models.attr('disabled', 'disabled');
                  $models.find('option').remove();
                  $models.append('&lt;option value="" selected&gt;' + '&lt;%=Html.Text("Name of search results filter:SelectModel") %&gt;' + '&lt;/option&gt;');
                  $models.val('');
                  UpdateVehicleCount();
                  $('#QSButton').attr('disabled', 'disabled');
                  $('#QSButtonDiv').removeClass('PrimaryButton').addClass('Button');
                  return;
              }
  
              $.ajax({
                  type: 'GET',
                  url: '/Search/GetModelsForMake/',
                  data: { MakeName: make },
                  dataType: "json",
                  success: function (results) {
                      $models.find('option').remove();
                      $models.append('&lt;option value="" selected&gt;' + '&lt;%=Html.Text("Labels for vehicle characteristics:All Models") %&gt;' + '&lt;/option&gt;');
                      $(results.Models).each(function (index, model) {
                          $models.append('&lt;option value="' + model + '"&gt;' + model + '&lt;/option&gt;');
                      });                    
                      DisplayVehicleCount(results.VehicleCount);
                  }
              });
              $models.removeAttr('disabled');
              $('#QSButton').removeAttr('disabled', 'disabled');
              $('#QSButtonDiv').removeClass('Button').addClass('PrimaryButton');
          }
  
          function UpdateVehicleCount() {
              var make = $('#Makes').val();
              var model = $('#Models').val();
  
              $.ajax({
                  type: 'GET',
                  url: '/Search/GetMakeModelCount/',
                  data: { MakeName: make, ModelName: model },
                  dataType: "json",
                  success: function (result) {
                      DisplayVehicleCount(result);
                  }
              });
          }
  
          function DisplayVehicleCount(vehicleCount) {
              var vehicles = (vehicleCount == '1') ? vehiclesSingular : vehiclesPlural;
              $('#VehicleCount').html('&lt;span class="count-number"&gt;' + vehicleCount + '&lt;/span&gt;' + ' ' + vehicles);
          }
  
      });
  
      function ExecuteSearch() {
          var make = $('#Makes').val();
          var model = $('#Models').val();
  
          if (make == '')
              return;
  
          window.location = '/Quicksearch/Vehicles?make=' + make + '&amp;model=' + model;
      }
  
      function AdvancedSearch() {
              &lt;% if(AmbientContextHelper.CurrentBrand.Name.ToLower().Contains("alphabet"))
             { %&gt;
              window.location = '/SearchVehicle';
              &lt;% } else 
             { %&gt;
              window.location = '/Quicksearch/Vehicles';
              &lt;% } %&gt;
          }
  &lt;/script&gt;
  </code></pre>