我有以下控制:
<radcb:radcombobox id="rdCboState" Runat="server" CssClass="Control" height="200" text="--Select--"
EnableLoadOnDemand="false" width="100" MarkFirstMatch="True" skin="WindowsXP"></radcb:radcombobox>
我把这个子程序添加到我的。asx .vb代码后面:
Private Sub rdCboState_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
testBinding.Text = "Test"
End Sub
然而,当我改变rdCboState
下拉框的值时,我的testBinding
文本不会改变。
当我改变下拉菜单时,我怎样才能让文本改变?
编辑:我已经尝试过这样做了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: Method 'Protected .编译错误subrdbostate_selectedindexchanged(0作为对象,e作为对象radcomboboxselectedindexchangedeventargs)'没有与delegate ' delegate Sub有相同的签名RadComboBoxSelectedIndexChangedEventHandler(0作为对象,e作为对象Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs)"。
我改变了我的方法签名根据错误,它的工作;然而,我的一些控件是隐藏的,但我认为这是一个单独的问题:
Protected Sub rdCboState_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs)