title: Razor code in javascript
body: <p>I have a little problem.
  I use asp.net mvc 5 and want to generate a 
  DropdownlistFor by razor in javascript:</p>
  
  <pre><code>function addRowIndikator() {
    var table = document.getElementById("tb_1");
    var count = table.rows.length;
    var row = table.insertRow(count - 2);
    var cell1 = row.insertCell(0);
    cell1.innerHTML = "3";
    cell1.colSpan = 3;
    var cell3 = row.insertCell(1);
    cell3.innerHTML = @if(Model._LIndikator != null) {
      @Html.DropDownListFor(m =&gt; m._Indikator.Id, new SelectList(Model._LIndikator, "Id", "Name"), new {
        id = "selectIndi"
      })
    }
    else { &lt;
      select &gt;
        &lt;
        option &gt; Keine Indikatoren vorhanden &lt; /option&gt; &lt;
        /select&gt;
    }
  };
  </code></pre>
  
  <p>But it doesn't work. Does someone have an idea on how to fix this?</p>