title: <asp:Button CommandArgument=<%: variable %> does not work -" variable" not populating with "value"
body: <p>I'm trying to pass a variable into my "asp:Button CommandArgument" - I know that I've got to jump through some hoops as runat=server is set, but I have tried everything I have found so far, but to no avail</p>
  
  <p>I know that my code behind works nicely as, if I explicitly define the variables in my "asp:Button CommandArgument" everything works - but as soon as I try to insert a variable via &lt;% %> syntax?  The variable is NOT replaced by the string it represents</p>
  
  <p>I'm using vStudio 2019 community preview (and 2017) as my IDE, targeting .net framework 4.7.2 - everything builds cleanly, and I know that the value for the variable is being set - it's jut not making it into my "asp:Button CommandArgument" and I need it to</p>
  
  <p>I've tried everything I have found - all permutations of the &lt;% $> syntax I can find, tried using CodeExpressionBuilder</p>
  
  <p>The pertinent part of my problematic code is</p>
  
  <pre><code>&lt;% if (variable is "value") { %&gt;
  
  &lt;asp:Button ID = "button1" 
      runat = "server" 
      Text = "Processing '&lt;%: variable %&gt;' Records" 
      CommandArgument = '&lt;%: variable %&gt;' 
      OnCommand = "button1_Click" 
  /&gt;
  
  &lt;% } %&gt;
  
  </code></pre>
  
  <p>I expect the variable I am inserting into the "asp:Button CommandArgument" to be replaced by it's current value</p>
  
  <p>What I get? Various error messages and the literal translation of my ' or " wrapped &lt;%: &lt;%# &lt;%= variable %> which doesn't help</p>
  
  <p>I know I can hard-code some of what I want to accomplish - but that's not optimal, and doesn't help me when I want to pass variable dates to my procedures via "asp:Button CommandArgument"</p>
  
  <p>I know I must be doing something wrong - but cannot, for the life of me, figure out what</p>
  
  <p>Any suggestions?</p>