Dynamic ID's for HTML ELements -


lets in aspx page have loop , within loop want create elements. how can generate id 's dynamically them.

for instance if have :

    <div>     <% foreach (item in itemcollection) { %>     {        <table>       <tr>       here want create td elements id recontext1 recontext2...the numbers @ end incrementing index.      </tr>    </table>     }  </div> 

you use for loop index or separate index variable foreach:

<% int = 1; %> <% foreach (item in itemcollection) { %>     <tr>         <td id="recontext<%= %>">...</td>     </tr>     <% i++; %> <% } %> 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -