我有如下的Radcombobox
<radC:RadComboBox ID="Type" Style="padding-left: 2px;" MarkFirstMatch="true"
runat="server" Skin="WebBlue" OnSelectedIndexChanged="ResidenceType_SelectedIndexChanged" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged"
AutoPostBack="true">
<Items>
<radC:RadComboBoxItem ID="ComboBoxItem1" runat="server" Text="Home" Value="Home" />
<radC:RadComboBoxItem ID="ComboBoxItem2" runat="server" Text="Condo" Value="Condo" />
<radC:RadComboBoxItem ID="ComboBoxItem3" runat="server" Text="Rent" Value="Rent" />
</Items>
</radC:RadComboBox>
我想使用j.script从下拉列表中捕获新更改的值。我没有得到它,它显示以前的价值。
function OnClientSelectedIndexChanged(sender, eventArgs)
{
var name1 = "<% =Type.SelectedValue %>";
// var name1 = eventArgs.get_item();
alert(name1);
}
答案 0 :(得分:1)
试试这个
function OnClientSelectedIndexChanged(sender, eventArgs)
{
var item = eventArgs.get_item();
alert("Selected value: " + item.get_value());
}