-1
htmlコード:データリストの変更された値のドロップダウンリストを取得するには?
<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" OnItemDataBound="DataList1_ItemDataBound" OnSelectedIndexChanged="DataList1_SelectedIndexChanged">
<ItemTemplate>
<asp:DropDownList ID="listedad" data-max="30" runat="server" OnSelectedIndexChanged="DataList1_SelectedIndexChanged">
と後ろの私のコード:
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
int tedadkala = Convert.ToInt32(((DropDownList)e.Item.FindControl("listedad")).Text);
int gheymat =
Convert.ToInt32(((Label)e.Item.FindControl("lblvahed")).Text);
int batedad = gheymat * tedadkala;
((Label)e.Item.FindControl("lblhesab")).Text = batedad.ToString();
((Label)e.Item.FindControl("lblhesab")).DataBind();
}
protected void DataList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
ページロードが気になるときだけですが、ドロップダウンリストを変更した後: –
データリストにdropdown_textchangeイベントがありません。本当に必要です助けて –