title: The tag helper 'input' must not have C# in the element's attribute declaration area
body: <p>We are experiencing the following error when build ASP.NET Core MVC application which is recently migrated from .NET Core 2.2 to 3.0: </p>
  
  <blockquote>
    <p>The tag helper 'input' (or 'textarea' or any other) must not have C#
    in the element's attribute declaration area.</p>
  </blockquote>
  
  <p>We used Razor <code>@functions</code> to return HTML attribute content in order to overcome that issue but it looks ugly when you use variable for returning it from function without any extra logic (function <code>dummy(htmlAttributeContent)</code> return <code>htmlAttributeContent</code>)</p>
  
  <pre><code>@{
      var roAttrHTML = "";
      if (!user.GotAccessToken("someToken")) {
          roAttrHTML = " readonly=\"readonly\" ";
      }
  }
  &lt;textarea class="testClass" asp-for="testId" @readonlyAttribute&gt;@Model.Id&lt;/textarea&gt;
  </code></pre>
  
  <p>Actually we got error </p>
  
  <blockquote>
    <p>The tag helper 'textarea' must not have C# in the element's attribute
    declaration area.</p>
  </blockquote>
  
  <p>when compile our ASP.NET Core MVC application whereas we need to get approach (better without <code>@functions</code> usage) which will provide us a way to overcome that issue (as we have plenty of pages with similar logic which we need to touch once and avoid any possible problems with presumable new changes in support of attributes in the future .NET Core versions)</p>