我将这些隐藏的输入字段添加到面板中:
foreach (Object obj in Objects)
{
HiddenField hf = new HiddenField();
hf.Value = "";
hf.ID = "categoria" + obj.ID;
panelCategorieGuida.Controls.Add(hf);
}
但是,在每个隐藏字段周围,我需要添加以下代码:
<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>
我想避免写Literal
在cs上并将它们添加到面板中。
你能给我什么建议?