1
리터럴, 드롭 다운 목록 및 버튼이있는 리피터가 있습니다.드롭 다운 목록이있는 리피터 내부 버튼
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="rep_ItemDataBound" onitemcommand="Repeater1_ItemCommand">
<ItemTemplate>
<div class="buypanel">
<ul>
<li>Choose finish <asp:DropDownList ID="ddlFinish" runat="server"></asp:DropDownList></li>
<li>Qty <asp:Literal ID="ltQty" runat="server"></asp:Literal></li>
<li><asp:Button ID="butBuy" runat="server" Text="Button" /></li>
</ul>
</div>
</ItemTemplate>
</asp:Repeater>
내가
protected void rep_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Products product = (Products) e.Item.DataItem;
//Dropdownlist to be bound.
//Set Buy Button
var butBuy = (Button) e.Item.FindControl("butBuy");
butBuy.CommandName = "Buy";
butBuy.CommandArgument = product.Id.ToString();
}
}
처럼 뒤에 코드에서 모든 정보를 결합하고 그리고 난 내 itemcommand 내가 얼마나 확실하지 않다
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if(e.CommandName == "Buy")
{
}
}
버튼을 클릭 데리러해야 주어진 버튼 클릭으로, 텍스트 상자와 그 옆에있는 드롭 다운 목록에서 올바른 정보를 가져올 수 있습니까?
새로운 것을 고맙습니다. 뭔가 간단 할 것입니다. 그러나 언제나 그 단순한 것이 무엇인지를 아는 것입니다. – TheAlbear