我想让我的转发器中的项目在一个 div 和一个新 div 中的 5 个元素之后。
所以我目前得到的是:
看法:
<ItemTemplate>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
</div>
</ItemTemplate>
后面的代码:
protected void DatesRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
var data = (Components.Models.GetDatesModel)e.Item.DataItem;
var chk = (CheckBox)e.Item.FindControl("eventDateCheckbox");
chk.Text = data.EventTimeBegin.ToString();
var hfd = (HiddenField)e.Item.FindControl("eventID");
hfd.Value = data.eventID.ToString();
}
}
我想在视图上这样显示它:
<div class="column">
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
</div>
<div class="column">
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
</div>
<div class="column">
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
<asp:HiddenField runat="server" ID="eventID" />
<p><asp:CheckBox runat="server" ID="eventDateCheckbox" /></p>
</div>
我怎样才能做到这一点?提前致谢!