Hi,
I want to add a readonly="readonly" attribute to a input type text element based on something at runtime, this is what I have but it doesn't work :
<input asp-for="NoOfTelephoneNumbers" class="form-control" @if(!Model.FullEditing) {<text>readonly="readonly"</text>} />
However if it was an element with no asp- attributes then it is allowed :
<input type="text" name="NoOfTelephoneNumbers" @if (!Model.FullEditing) {<text>readonly="readonly"</text>} />
Obviously I can just have an if else statement and have 2 different <input as-for... elements but it seems a shame to repeat everything.