1

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

注意:Dropdown 的 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”)来捕获参数。请给我一些提示。

4

1 回答 1

0

您提供的信息很少,很难知道您的要求。

但在我看来,你可以试试这个:

使用 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 参数只能在服务器代码中检索。

于 2012-01-21T09:45:17.510 回答