I add these hidden input fields into a panel :
foreach (Object obj in Objects)
{
HiddenField hf = new HiddenField();
hf.Value = "";
hf.ID = "categoria" + obj.ID;
panelCategorieGuida.Controls.Add(hf);
}
but, around each hidden fields, I need to add this code :
<div class="option-box"><a href="javascript:void(0);" class="option-box-item"> </a>
<span class="option-box-testo">Hello</span>
<!-- HERE I NEED TO PUT THE HIDDEN FIELD i, so think to this whole option-box item into a cycle -->
</div>
I’d like to avoid to write Literal on the cs and add them into the panel.
What can you suggest to me?
You could use Repeater control, markup :
code behind :
Of course you will have to bind repeater with Objects list