title: Why do my styles stop working in the DETAIL mode, UPDATE and if they do it in SAVE (same ASP.NET view)?
body: <p>Good morning everyone,
  I have an inconvenient in one of my ASP .NET views that is driving me crazy. I have a complete maintenance for a module, consisting of searches, detail, update and registration. For this detail, update and record use the same view only that, depending on the case, the text entries and buttons are drawn in the view with SWITCH's. Until a few days ago everything worked fine, however, I added some extra text entries and other minor changes. Today, I have finished developing the module; I have tried the save view and everything is fine, but when I try the same view in detail mode and update, all my styles disappear. I even see, my Layout without formatting. I read the console and it tells me that it does not find the files and it seems super strange since it is the same view as in the save mode. I would greatly appreciate your help, thanks in advance, anyway.</p>
  
  <p>optimum
  <a href="https://i.stack.imgur.com/cp4HP.gif" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>not optimal
  <a href="https://i.stack.imgur.com/v6aNc.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  
  <pre><code>@model CaucionesWeb.Models.CGRegistroViewModel
  
  @{
      ViewBag.Title = "Contragarantías";
  
      string VistaSeleccionada = ViewBag.VistaSeleccionada;
      string Action = VistaSeleccionada.Equals("Obtener") ? "Aprobar" : VistaSeleccionada;
  
      string descriptionStatusWarr = string.Empty;
      string descriptionTypeWarr = string.Empty;
      string descriptionCurrency = string.Empty;
      string descriptionStatusSit = string.Empty;
  
      string disabledClass = string.Empty;
  }
  
  @using (Html.BeginForm(Action, "CGRegistro", FormMethod.Post, new { id = "formulario" }))
  {
      @Html.AntiForgeryToken()
      &lt;div class="container-fluid"&gt;
          &lt;div class="title clear"&gt;
              &lt;h1 class="fl-left fz-22 push-0"&gt;Contragarantías: Registro&lt;/h1&gt;
              &lt;div class=" btn-group push-top-0"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="pull-right"&gt;
                          @switch (VistaSeleccionada)
                          {
                              case "Obtener":
                                  switch (Convert.ToInt32(Session["SchemeId"]))
                                  {
                                      case 1:
                                          &lt;a href="@Url.Action("Index", "CGRegistro")" class="btn btn-secondary mr-1 mt-1"&gt;Nuevo&lt;/a&gt;
                                          &lt;a href="@Url.Action("Index", "CGRegistro", new { VistaSeleccionada = "actualizar", id = Model.WarrantiesId, EffectDate = Model.EffectDate })" class="btn btn-primary mr-1 mt-1"&gt;Editar&lt;/a&gt;
                                          break;
                                      case 2:
                                          &lt;a href="@Url.Action("Index", "CGRegistro")" class="btn btn-secondary mr-1 mt-1"&gt;Nuevo&lt;/a&gt;
                                          &lt;a href="@Url.Action("Index", "CGRegistro", new { VistaSeleccionada = "actualizar", id = Model.WarrantiesId, EffectDate = Model.EffectDate })" class="btn btn-primary mr-1 mt-1"&gt;Editar&lt;/a&gt;
                                          break;
                                      case 4:
                                          switch (Model.StatusWarr)
                                          {
                                              case 2:
                                                  &lt;button type="button" class="btn btn-primary mr-1 mt-1 disabled"&gt;Aprobar&lt;/button&gt;
                                                  break;
                                              case 3: //
                                                  &lt;button type="button" class="btn btn-primary mr-1 mt-1 disabled"&gt;Aprobar&lt;/button&gt;
                                                  break;
                                              default:
                                                  if (Convert.ToDateTime(Model.EffectDate) &gt;= Model.d_hoy) //SI LA CG A APROBAR ES O HA PASADO LA FECHA DE EFECTO
                                                  {
                                                      &lt;button type="button" class="btn btn-primary mr-1 mt-1 disabled"&gt;Aprobar&lt;/button&gt;
                                                  }
                                                  else
                                                  {
                                                      &lt;button type="submit" class="btn btn-primary mr-1 mt-1"&gt;Aprobar&lt;/button&gt;
                                                  }
                                                  break;
                                          }
                                          break;
                                      case 5:
                                      &lt;!--NADA--&gt;
                                          break;
                                  }
                                  break;
                              case "Actualizar":
                                  &lt;button id="btnAceptar" type="submit" class="btn btn-primary mr-1 mt-1"&gt;Aceptar&lt;/button&gt;
                                  break;
                              case "Guardar":
                                  &lt;button id="btnAceptar" type="submit" class="btn btn-primary mr-1 mt-1"&gt;Aceptar&lt;/button&gt;
                                  break;
                          }
                          &lt;a href="@Url.Action("Index", "CGConsulta")" class="btn btn-outline-primary mr-1  mt-1"&gt;Cancelar&lt;/a&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="col-md-6 mb-mt pr-4 pt-1 pl-2 "&gt;
          &lt;h4&gt;Datos Generales&lt;/h4&gt;
          &lt;div class="line-x"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="push-top-0"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-12 mb-mt"&gt;
                  &lt;div class="col-md-3"&gt;
                      &lt;div class="pt-1 pr-4 pl-2"&gt;
                          &lt;div class="ui-input ui-field readonly"&gt;
                              @if (VistaSeleccionada.Equals("Guardar"))
                              {
                                  &lt;input class="ui-field-input " readonly="" /&gt;
                              }
                              else
                              {
                                  @Html.TextBoxFor(m =&gt; m.WarrantiesId, new { @class = "ui-field-input", @readonly = "true" })
                              }
                              @Html.LabelFor(m =&gt; m.WarrantiesId, new { @class = "ui-field-label" })
                              &lt;div class="ui-field-hr"&gt;
                                  &lt;hr class="ui-field-hr-highlight"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="col-md-3"&gt;
                      &lt;div class="pt-1 pr-4 pl-2"&gt;
  
                          @Html.HiddenFor(m =&gt; m.StatusWarr)
  
                          @foreach (var item in Model.StatusWarrList)
                          {
                              if (item.value == Model.StatusWarr)
                              {
                                  descriptionStatusWarr = item.name;
                              }
                          }
  
                          @switch (VistaSeleccionada)
                          {
                              case "Obtener":
                                  &lt;div class="ui-input ui-field"&gt;
                                      @Html.TextBox("x", descriptionStatusWarr, new { @class = "ui-field-input", @readonly = "true" })
                                      @Html.LabelFor(m =&gt; m.StatusWarr, new { @class = "ui-field-label" })
                                      &lt;div class="ui-field-hr"&gt;
                                          &lt;hr class="ui-field-hr-highlight"&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  break;
                              case "Actualizar":
                                  &lt;div class="ui-input ui-field"&gt;
                                      @Html.TextBox("x", descriptionStatusWarr, new { @class = "ui-field-input", @readonly = "true" })
                                      @Html.LabelFor(m =&gt; m.StatusWarr, new { @class = "ui-field-label" })
                                      &lt;div class="ui-field-hr"&gt;
                                          &lt;hr class="ui-field-hr-highlight"&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  break;
                              case "Guardar":
                                  &lt;div class="ui-input ui-select ui-dropdown asiggned active disabled" id="cboStatusWarr"&gt;
                                      &lt;span class="icon ico-arrow-bottom"&gt;&lt;/span&gt;&lt;span for="input-8" class="ui-select-label"&gt;@Html.DisplayNameFor(m =&gt; m.StatusWarr)&lt;/span&gt;
                                      &lt;input class="ui-select-filter"&gt;
                                      &lt;div class="ui-select-btn"&gt;&lt;span class="ui-select-value"&gt;Pte. de Aprobación&lt;/span&gt;&lt;/div&gt;
                                      &lt;div class="ui-select-hr"&gt;
                                          &lt;hr class="ui-select-hr-highlight"&gt;
                                      &lt;/div&gt;
                                      &lt;div class="ui-dropdown-content"&gt;
                                          &lt;ul class="ui-dropdown-list"&gt;
                                              @foreach (var item in Model.StatusWarrList)
                                              {
                                                  &lt;li class="ui-dropdown-list-item" data-value="@item.value" data-label="@item.name"&gt;&lt;span&gt;@item.name&lt;/span&gt;&lt;/li&gt;
                                              }
                                          &lt;/ul&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  break;
                          }
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="col-md-12 mb-mt"&gt;
                  ...
              &lt;/div&gt;
              &lt;div class="col-md-12 mb-mt"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-md-3"&gt;
                          &lt;div class="pt-1 pr-4 pl-2"&gt;
                              @foreach (var item in Model.TypeWarrList)
                              {
                                  if (item.value == Model.TypeWarr)
                                  {
                                      descriptionTypeWarr = item.name;
                                  }
                              }
  
                              @switch (VistaSeleccionada)
                              {
                                  case "Obtener":
                                      &lt;div class="ui-input ui-select ui-dropdown asiggned active disabled" id="cboTypeWarr"&gt;
                                          &lt;span class="icon ico-arrow-bottom"&gt;&lt;/span&gt;&lt;span for="input-8" class="ui-select-label"&gt;@Html.DisplayNameFor(m =&gt; m.TypeWarr)&lt;/span&gt;
                                          &lt;input class="ui-select-filter"&gt;
                                          &lt;div class="ui-select-btn"&gt;&lt;span class="ui-select-value"&gt;@descriptionTypeWarr&lt;/span&gt;&lt;/div&gt;
                                          &lt;div class="ui-select-hr"&gt;
                                              &lt;hr class="ui-select-hr-highlight"&gt;
                                              @Html.TextBoxFor(m =&gt; m.TypeWarr, new { @class = "input-invisible" })
  
                                          &lt;/div&gt;
  
                                          &lt;div class="ui-dropdown-content"&gt;
                                              &lt;ul class="ui-dropdown-list"&gt;&lt;/ul&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      break;
                                  case "Actualizar":
                                      switch (Model.StatusWarr)
                                      {
                                          case 2:
                                              disabledClass = "disabled";
                                              break;
                                          default:
                                              disabledClass = string.Empty;
                                              break;
                                      }
                                      &lt;div class="ui-input ui-select ui-dropdown asiggned active @disabledClass" id="cboTypeWarr"&gt;
                                          &lt;span class="icon ico-arrow-bottom"&gt;&lt;/span&gt;&lt;span for="input-8" class="ui-select-label"&gt;@Html.DisplayNameFor(m =&gt; m.TypeWarr)&lt;/span&gt;
                                          &lt;input class="ui-select-filter"&gt;
                                          &lt;div class="ui-select-btn"&gt;&lt;span class="ui-select-value"&gt;@descriptionTypeWarr&lt;/span&gt;&lt;/div&gt;
                                          &lt;div class="ui-select-hr"&gt;
                                              &lt;hr class="ui-select-hr-highlight"&gt;
                                              @Html.TextBoxFor(m =&gt; m.TypeWarr, new { @class = "input-invisible", @required = "true" })
                                          &lt;/div&gt;
                                          &lt;div class="ui-dropdown-content"&gt;
                                              &lt;ul class="ui-dropdown-list"&gt;
                                                  @if (string.IsNullOrEmpty(disabledClass))
                                                  {
                                                      foreach (var item in Model.TypeWarrList)
                                                      {
                                                          &lt;li class="ui-dropdown-list-item" data-value="@item.value" data-label="@item.name"&gt;&lt;span&gt;@item.name&lt;/span&gt;&lt;/li&gt;
                                                      }
                                                  }
                                              &lt;/ul&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      break;
                                  case "Guardar":
                                      &lt;div class="ui-input ui-select ui-dropdown asiggned" id="cboTypeWarr"&gt;
                                          &lt;span class="icon ico-arrow-bottom"&gt;&lt;/span&gt;&lt;span for="input-8" class="ui-select-label"&gt;@Html.DisplayNameFor(m =&gt; m.TypeWarr)&lt;/span&gt;
                                          &lt;input class="ui-select-filter"&gt;
                                          &lt;div class="ui-select-btn"&gt;&lt;span class="ui-select-value"&gt;&lt;/span&gt;&lt;/div&gt;
                                          &lt;div class="ui-select-hr"&gt;
                                              &lt;hr class="ui-select-hr-highlight"&gt;
                                              @Html.TextBoxFor(m =&gt; m.TypeWarr, new { @class = "input-invisible", @required = "true", @Value = "" })
                                          &lt;/div&gt;
                                          &lt;div class="ui-dropdown-content"&gt;
                                              &lt;ul class="ui-dropdown-list"&gt;
                                                  @foreach (var item in Model.TypeWarrList)
                                                  {
                                                      &lt;li class="ui-dropdown-list-item" data-value="@item.value" data-label="@item.name"&gt;&lt;span&gt;@item.name&lt;/span&gt;&lt;/li&gt;
                                                  }
                                              &lt;/ul&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      break;
                              }
                          &lt;/div&gt;
                      &lt;/div&gt;
                      ...
                  &lt;/div&gt;
              &lt;/div&gt;
              ...
              ...
                  &lt;div class="col-md-12 mb-mt"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="pt-2 pr-4 pl-2"&gt;
                                  @switch (VistaSeleccionada)
                                  {
                                      case "Obtener":
                                          &lt;div class="ui-input ui-field"&gt;
                                              @Html.TextBoxFor(m =&gt; m.AvalName, new { @class = "ui-field-input", @readonly = "true" })
                                              @Html.LabelFor(m =&gt; m.AvalName, new { @class = "ui-field-label" })
                                              &lt;div class="ui-field-hr"&gt;
                                                  &lt;hr class="ui-field-hr-highlight"&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                          break;
                                      case "Actualizar":
                                          switch (Model.StatusWarr)
                                          {
                                              case 2: //APROBADA
                                                  &lt;div class="ui-input ui-field"&gt;
                                                      @Html.TextBoxFor(m =&gt; m.AvalName, new { @class = "ui-field-input", @readonly = "true" })
                                                      @Html.LabelFor(m =&gt; m.AvalName, new { @class = "ui-field-label" })
                                                      &lt;div class="ui-field-hr"&gt;
                                                          &lt;hr class="ui-field-hr-highlight"&gt;
                                                      &lt;/div&gt;
                                                  &lt;/div&gt;
                                                  break;
                                              default:
                                                  &lt;div class="ui-input ui-field"&gt;
                                                      @Html.TextBoxFor(m =&gt; m.AvalName, new { @class = "ui-field-input", @required = "true" })
                                                      @Html.LabelFor(m =&gt; m.AvalName, new { @class = "ui-field-label" })
                                                      &lt;div class="ui-field-hr"&gt;
                                                          &lt;hr class="ui-field-hr-highlight"&gt;
                                                      &lt;/div&gt;
                                                  &lt;/div&gt;
                                                  break;
                                          }
                                          break;
                                      case "Guardar":
                                          &lt;div class="ui-input ui-field"&gt;
                                              @Html.TextBoxFor(m =&gt; m.AvalName, new { @class = "ui-field-input", @required = "true" })
                                              @Html.LabelFor(m =&gt; m.AvalName, new { @class = "ui-field-label" })
                                              &lt;div class="ui-field-hr"&gt;
                                                  &lt;hr class="ui-field-hr-highlight"&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                          break;
                                  }
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="pt-2 pr-4 pl-2"&gt;
                                  @foreach (var item in Model.StatusSitList)
                                  {
                                      if (item.value == Model.StatusSit)
                                      {
                                          descriptionStatusSit = item.name;
                                      }
                                  }
  
                                  @switch (VistaSeleccionada)
                                  {
                                      case "Obtener":
                                          &lt;div class="ui-input ui-select ui-dropdown assigned active disabled" id="cboStatusSit"&gt;
                                              &lt;span class="icon ico-arrow-bottom"&gt;&lt;/span&gt;&lt;span for="input-8" class="ui-select-label"&gt;@Html.DisplayNameFor(m =&gt; m.StatusSit)&lt;/span&gt;
                                              &lt;input class="ui-select-filter"&gt;
                                              &lt;div class="ui-select-btn"&gt;&lt;span class="ui-select-value"&gt;@descriptionStatusSit&lt;/span&gt;&lt;/div&gt;
                                              &lt;div class="ui-select-hr"&gt;
                                                  &lt;hr class="ui-select-hr-highlight"&gt;
                                                  @Html.TextBoxFor(m =&gt; m.StatusSit, new { @class = "input-invisible" })
                                              &lt;/div&gt;
                                              &lt;div class="ui-dropdown-content"&gt;
                                                  &lt;ul class="ui-dropdown-list"&gt;
                                                      @foreach (var item in Model.StatusSitList)
                                                      {
                                                          &lt;li class="ui-dropdown-list-item" data-value="@item.value" data-label="@item.name"&gt;&lt;span&gt;@item.name&lt;/span&gt;&lt;/li&gt;
                                                      }
                                                  &lt;/ul&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                          break;
                                      case "Actualizar":
                                          &lt;div class="ui-input ui-select ui-dropdown assigned active" id="cboStatusSit"&gt;
                                              &lt;span class="icon ico-arrow-bottom"&gt;&lt;/span&gt;&lt;span for="input-8" class="ui-select-label"&gt;@Html.DisplayNameFor(m =&gt; m.StatusSit)&lt;/span&gt;
                                              &lt;input class="ui-select-filter"&gt;
                                              &lt;div class="ui-select-btn"&gt;&lt;span class="ui-select-value"&gt;@descriptionStatusSit&lt;/span&gt;&lt;/div&gt;
                                              &lt;div class="ui-select-hr"&gt;
                                                  &lt;hr class="ui-select-hr-highlight"&gt;
                                                  @Html.TextBoxFor(m =&gt; m.StatusSit, new { @class = "input-invisible", @required = "true" })
                                              &lt;/div&gt;
                                              &lt;div class="ui-dropdown-content"&gt;
                                                  &lt;ul class="ui-dropdown-list"&gt;
                                                      @foreach (var item in Model.StatusSitList)
                                                      {
                                                          &lt;li class="ui-dropdown-list-item" data-value="@item.value" data-label="@item.name"&gt;&lt;span&gt;@item.name&lt;/span&gt;&lt;/li&gt;
                                                      }
                                                  &lt;/ul&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                          break;
                                      case "Guardar":
                                          &lt;div class="ui-input ui-select ui-dropdown" id="cboStatusSit"&gt;
                                              &lt;span class="icon ico-arrow-bottom"&gt;&lt;/span&gt;&lt;span for="input-8" class="ui-select-label"&gt;@Html.DisplayNameFor(m =&gt; m.StatusSit)&lt;/span&gt;
                                              &lt;input class="ui-select-filter"&gt;
                                              &lt;div class="ui-select-btn"&gt;&lt;span class="ui-select-value"&gt;&lt;/span&gt;&lt;/div&gt;
                                              &lt;div class="ui-select-hr"&gt;
                                                  &lt;hr class="ui-select-hr-highlight"&gt;
                                                  @Html.TextBoxFor(m =&gt; m.StatusSit, new { @class = "input-invisible", @required = "true", @Value = "" })
                                              &lt;/div&gt;
                                              &lt;div class="ui-dropdown-content"&gt;
                                                  &lt;ul class="ui-dropdown-list"&gt;
                                                      @foreach (var item in Model.StatusSitList)
                                                      {
                                                          &lt;li class="ui-dropdown-list-item" data-value="@item.value" data-label="@item.name"&gt;&lt;span&gt;@item.name&lt;/span&gt;&lt;/li&gt;
                                                      }
                                                  &lt;/ul&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                          break;
                                  }
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="col-md-6 mb-mt pr-4 pt-1 pl-2 "&gt;
                      &lt;h4&gt;Información Adicional&lt;/h4&gt;
                      &lt;div class="line-x"&gt;&lt;/div&gt;
                      @switch (VistaSeleccionada)
                      {
                          case "Obtener":
                              &lt;div class="ui-input ui-field ui-field-textarea focus-textarea"&gt;
                                  @Html.TextAreaFor(m =&gt; m.Coments, new { @class = "ui-field-input", @readonly = "true" })
                                  @Html.LabelFor(m =&gt; m.Coments)
                                  &lt;div class="ui-field-hr"&gt;
                                      &lt;hr class="ui-field-hr-highlight"&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              break;
                          case "Actualizar":
                              switch (Model.StatusWarr)
                              {
                                  case 2:
                                      &lt;div class="ui-input ui-field ui-field-textarea focus-textarea"&gt;
                                          @Html.TextAreaFor(m =&gt; m.Coments, new { @class = "ui-field-input", @readonly = "true" })
                                          @Html.LabelFor(m =&gt; m.Coments)
                                          &lt;div class="ui-field-hr"&gt;
                                              &lt;hr class="ui-field-hr-highlight"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      break;
                                  default:
                                      &lt;div class="ui-input ui-field ui-field-textarea focus-textarea"&gt;
                                          @Html.TextAreaFor(m =&gt; m.Coments, new { @class = "ui-field-input" })
                                          @Html.LabelFor(m =&gt; m.Coments)
                                          &lt;div class="ui-field-hr"&gt;
                                              &lt;hr class="ui-field-hr-highlight"&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      break;
                              }
                              break;
                          case "Guardar":
                              &lt;div class="ui-input ui-field ui-field-textarea"&gt;
                                  @Html.TextAreaFor(m =&gt; m.Coments, new { @class = "ui-field-input" })
                                  @Html.LabelFor(m =&gt; m.Coments)
                                  &lt;div class="ui-field-hr"&gt;
                                      &lt;hr class="ui-field-hr-highlight"&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              break;
                      }
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  }
  @section Scripts {
      &lt;script type="text/javascript"&gt;
          ...
      &lt;/script&gt;
  }
  </code></pre>