title: Razor is not if statement type does not exist
body: <p>I am getting refType does not exist in the current content. I am passing it in as a parameter so I am not sure why I can't use it.</p>
  
  <p>Calling function</p>
  
  <pre><code>$.each(references, function (index, item) {
      console.log(item);
      $(".references-list ol").append(referenceTmpl(item.Text, item.Link, item.RegimensCommaList, referenceIndex++, item.GuidelineId, item.GuidelineExternalReference, item.Type));
      buildReferences();
  });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yc5Fp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yc5Fp.png" alt="enter image description here"></a></p>
  
  <p>cshtml </p>
  
  <pre><code>function referenceTmpl(text, link, regimens, index, guidelineId, guidelineExternalReference,type) {
          var refType = type;
          @if (Model.Editable) {
              &lt;text&gt;var refDel = "&lt;a href='#' class='glyphicon glyphicon-trash delete-reference' title='Delete'&gt;&lt;/a&gt;";&lt;/text&gt;
              if (refType = 'AMode')
              {
                  &lt;text&gt;var refEdit = "";&lt;/text&gt;
              }
              else
              {
                  &lt;text&gt;var refEdit = "&lt;a href='#' data-index='" + index + "' class='glyphicon glyphicon-edit edit-reference' title='Edit'&gt;&lt;/a&gt;";&lt;/text&gt;
              }
  
          } else {
              &lt;text&gt;var refDel = "";&lt;/text&gt;
              &lt;text&gt;var refEdit = "";&lt;/text&gt;
          }
  
      if (type == "A-Mode"){
          refEdit = "";
      }
  }
  </code></pre>