我有以下控件:
<radcb:radcombobox id="rdCboState" Runat="server" CssClass="Control" height="200" text="--Select--"
EnableLoadOnDemand="false" width="100" MarkFirstMatch="True" skin="WindowsXP"></radcb:radcombobox>
我已将此子例程添加到我的.ascx.vb代码后面:
Private Sub rdCboState_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
testBinding.Text = "Test"
End Sub
但是,当我更改testBinding
下拉列表的值时,我的rdCboState
文字没有变化。
如何在更改下拉列表时更改文本?
修改:我按照http://www.telerik.com/help/aspnet-ajax/combobox-server-side-selectedindexchanged.html尝试了这样做:
<radcb:radcombobox id="rdCboState" Runat="server" CssClass="Control" height="200" text="--Select--"
EnableLoadOnDemand="false" width="100" MarkFirstMatch="True" skin="WindowsXP" autopostback="True" OnSelectedIndexChanged="rdCboState_SelectedIndexChanged"></radcb:radcombobox>
而且,我的代码隐藏为:
Protected Sub rdCboState_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
testBinding.Text = "Test"
End Sub
但是,当我尝试加载页面时出现此错误:
编译错误编译器错误消息:BC30408:方法'受保护 Sub rdCboState_SelectedIndexChanged(o As Object,e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)'没有 与代表'Delegate Sub'具有相同的签名 RadComboBoxSelectedIndexChangedEventHandler(o As Object,e As Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs)”
答案 0 :(得分:0)
我根据错误改变了我的方法签名并且它有效;但是,我的一些控件是隐藏的,但我认为这是一个单独的问题:
Protected Sub rdCboState_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs)