title: Razor View if/else statement in javascript
body: <p>Is it possible to do this in the razor View . I want to inject below JavaScript only if statement is true else not. How can i do this.</p>
  
  <pre><code>            @if (Model.EmployeeInterviews != null)
              {
                  $("#select-Candidate")[0].selectize.setValue(@Html.Raw(JsonConvert.SerializeObject(Model.CandidateId)));
                  var employee = @Html.Raw(JsonConvert.SerializeObject(selectedempobj));
                  var val = "[";
                  for (i = 0; i &lt; employee.length; i++)
                  {
                      val += employee[i].EmployeeID + ",";
                  }
                  val = val.substring(0, val.length - 1) + "]";
  
                  $("#select-Employee")[0].selectize.setValue(JSON.parse(val));
                  $('#txtScheduledOn').val('@String.Format("{0:M/d/yyyy HH:mm tt}", Model.ScheduledOn)');
                  $('#txtCompletedOn').val('@String.Format("{0:M/d/yyyy HH:mm tt}", Model.CompletedOn)');
                  $('#hdnEmployeeId').val(JSON.parse(val).toString());
                  $('#hdnCandidateId').val('@Html.Raw(JsonConvert.SerializeObject(Model.CandidateId))');
              }
  </code></pre>