假设你的用户控件里面有:

<asp:DropDownList ID="DropDownList1" runat="server">
    <asp:ListItem Text="111" Value="111"></asp:ListItem>
</asp:DropDownList>

然后你在aspx页面中注册这个控件:

<%@ Register Src="~/WebUserControl1.ascx" TagName="ssss" TagPrefix="guwei4037" %>

并且使用了它。再放一个按钮用于测试。

<div>
    <guwei4037:ssss ID="sss" runat="server" />
    <button onclick="return ttt()">清空</button>
</div>

js部分:

<script>
    function ttt() {
        var ctl = document.getElementById("<%=sss.FindControl("DropDownList1").ClientID%>");
        ctl.value = "";
        return false;
    }
</script>

当点击这个button时,dropdownlist清空(可以重新选择)。

相关文章:

  • 2021-11-30
  • 2021-09-20
  • 2022-02-09
  • 2022-12-23
  • 2023-01-21
  • 2021-11-23
猜你喜欢
  • 2021-07-10
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案