Input Tag Helper Not Working with Razor Code
<p>I want to combine an input tag helper with razor code to set an attribute but I cannot get the two technologies to work together. I am simply trying to set the disabled attribute on the input field based on the value of view model property.</p>

<p>When i put the razor code after the <code>asp-for</code> tag the razor intellisense is not recognized and the field is not disabled as expected...</p>

<pre><code>&lt;input asp-for="OtherDrugs" @((Model.OtherDrugs == null) ? "disabled" : "") class="form-control" /&gt;
</code></pre>

<p>Rendered output...</p>

<pre><code>&lt;input type="text" id="OtherDrugs" name="OtherDrugs" value="" /&gt;
</code></pre>

<p>When i put the razor code before the <code>asp-for</code> tag the tag helper intellisense is not recognized and the field is not set with the view model properties as expected...</p>

<pre><code>&lt;input @((Model.OtherDrugs == null) ? "disabled" : "") asp-for="OtherDrug" class="form-control" /&gt;
</code></pre>

<p>Rendered output...</p>

<pre><code>&lt;input disabled asp-for="OtherDrugs" class="form-control" /&gt;
</code></pre>

<p><strong>Note that combining tag helpers and razor does work if the razor code is inside a class attribute. Unfortunately input fields require the disabled attribute and not the disabled class for bootstrap 3.</strong></p>

<p>Is there a way to make this work?</p>