Assigning property to Control inside aspx file

  • Thread starter Thread starter Alexander Smirnov
  • Start date Start date
A

Alexander Smirnov

Hello

I have the following code (simplified) inside aspx file:

<% for(i=1;i<=someVariable;++i) { %>

<asp:LinkButton ID="lbSR" runat="server" OnCommand="OnAllCommands"
CommandName="scp" CommandArgument="<%=i %>"> <%=i %> </asp:LinkButton>

<% } %>

The problem is that the value of i is not assigned to CommandArgument
but the string "<%=i %>" itself.

How can I assign value of i to the CommandArgument in the above cycle?

thanks in advance
 
I don't think you can add <%=%> contructs to server tags , you would have to
do this is the code behind
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top