<html>
<script>
function SetYGXZ()
{
document.getElementById('<%=txtYGXZ.ClientID %>').value=document.getElementById('<%=ddlYGXZ.ClientID %>').value;
}
</script>
<body>
<div style="position: relative;">
<span style="margin-left: 132px; width: 18px; overflow: hidden;">
<asp:DropDownList ID="ddlYGXZ" runat="server" Style="width: 150px; margin-left: -132px"
onchange="javascript:SetYGXZ();">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>
</span>
<asp:TextBox ID="txtYGXZ" runat="server" Style="width: 133px; position: absolute;
left: 0px;">
</asp:TextBox>
</div>
</body>
</html>
ASP.NET 可编辑的下拉框(DropDownList)
最新推荐文章于 2018-08-16 15:21:21 发布
本文介绍了一个使用ASP.NET实现的简单示例,通过DropDownList的选择更改触发事件,将选择的值同步到TextBox中。该示例展示了如何利用客户端JavaScript进行DOM操作,以及服务器端控件之间的数据同步。

6403

被折叠的 条评论
为什么被折叠?



