title: Html.Kendo().Upload() dynamically enable or disable
body: <p>I need find a way to dynamically enable or disable a Kendo upload:</p>
  
  <pre><code>  @(Html.Kendo().Upload()
          .Enable(false)
          .Name("attachments_" + item.QuestionId)
          .ShowFileList(true)
              .TemplateId("fileTemplate")
          .Async(a =&gt; a
               .Save("SaveAttachment", "Attachment", new { evaluationId = ViewBag.EvaluationId, questionId = item.QuestionId })
               .Remove("RemoveAttachment", "Attachment", new { evaluationId = ViewBag.EvaluationId, questionId = item.QuestionId })
               .AutoUpload(true)
          )
          .Files(files =&gt;
          {
              if ((IList&lt;dynamic&gt;)ViewData["Attachment_" + item.QuestionId] != null)
              {
                  foreach (var f in (IList&lt;dynamic&gt;)ViewData["Attachment_" + item.QuestionId])
                  {
                      files.Add().Name(f.Name).Extension(f.Extension).Size(f.Size);
                  }
              }
          })
  )
  </code></pre>
  
  <p>How can I do that?</p>
  
  <p>I tried setting .Enable to:</p>
  
  <pre><code>.Enable(bool.Parse(ViewBag.AllowEdit))
  </code></pre>
  
  <p>And it threw an error:</p>
  
  <p>Server Error in '/' Application.
  Compilation Error
  Description: An error occurred during the compilation of a resource required to service this request.          Please review the following specific error details and modify your source code appropriately.</p>
  
  <p>Compiler Error Message: CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type</p>
  
  <p>Source Error:</p>
  
  <p>Line 95:             .ShowFileList(true)
  Line 96:                 .TemplateId("fileTemplate")
  Line 97:             .Async(a => a
  Line 98:                  .Save("SaveAttachment", "Attachment", new { evaluationId = ViewBag.EvaluationId, questionId = item.QuestionId })
  Line 99:                  .Remove("RemoveAttachment", "Attachment", new { evaluationId = ViewBag.EvaluationId, questionId = item.QuestionId })</p>
  
  <p>Is there a simpler way to do this?</p>