
asp:itemtemplate中DropdoWnList联动label
<asp:repeater><ItemTemplate><tr><td><asp:DropDownListid="species"runat="server"AutoPo...
<asp:repeater>
<ItemTemplate>
<tr>
<td>
<asp:DropDownList id="species" runat="server" AutoPostBack ="true" />
</td>
<td>
<asp:Label id="salesreal" runat="server" Text='<%# Eval("salesreal")%>' />
</td>
</tr>
</ItemTemplate>
</asp:repeater>
如何 dropdownlist 选择后 赋值 label 每行实现 展开
<ItemTemplate>
<tr>
<td>
<asp:DropDownList id="species" runat="server" AutoPostBack ="true" />
</td>
<td>
<asp:Label id="salesreal" runat="server" Text='<%# Eval("salesreal")%>' />
</td>
</tr>
</ItemTemplate>
</asp:repeater>
如何 dropdownlist 选择后 赋值 label 每行实现 展开
展开全部
<asp:DropDownList id="species" runat="server" AutoPostBack ="true" />使用它的默认触发事件,修改如下
<asp:DropDownList id="species" runat="server" AutoPostBack ="true" OnSelectedIndexChanged="changeText" />
函数:
<script language="VB" runat="server">
Sub changeText(ByVal Sender As Object, ByVal E As EventArgs)
salesreal.Text = " you selected: " & species.SelectedItem.Text
End Sub
</script>
演示结果:
初始化
选中触发事件
更多追问追答
追问
这是 JS吗? 前台写吗? Sub 写在前台 无法识别啊
追答
你这个不是.net的吗??怎么会无法识别呢??
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询