gpt4 book ai didi

javascript - 在同一 aspx 页面上的 commandArgument 中传递选定的下拉文本?

转载 作者:行者123 更新时间:2023-11-28 10:02:41 26 4
gpt4 key购买 nike

我想在按钮的commandArgument中传递选定的下拉文本(ddlTime)。

注意:下拉菜单的 Autopostback = false。

代码-ASPX-

 <asp:DropDownList ID="ddlTime" runat="server" AutoPostBack="false" Width="70">
</asp:DropDownList>
<telerik:RadButton ID="btnViewSun" runat="server" Text="View" CommandArgument="-pass selected value here-"
OnClientClicked="OnClientClicked_ViewAssignedCust" ButtonType="LinkButton" BorderStyle="None" />

我编写了一个 JS 函数(“OnClientClicked_ViewAssignedCust”)来捕获参数。请给我一些提示。

最佳答案

仅凭您提供的少量信息很难了解您的需求。

但从我的 Angular 来看,你可以尝试这个:

使用 JQuery 获取 javascript 事件中选定的值,如下所示:

$("#<%=ddlTime.ClientID%>").val();
or if you know the clientid of the dropdown use this:
$("#ddlTimeClientID").val(); //subs. ddlTimeClientID by the ddlTime controls client ID

CommandArgument 参数只能在服务器代码中检索。

关于javascript - 在同一 aspx 页面上的 commandArgument 中传递选定的下拉文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8951944/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com