Assigning property to Control inside aspx file

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
 
L

Lee Atkinson

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top