I am trying to use ObjectDataSource for the first time with my code but in its SelectMethod I am always getting the Control as null.
ObjectDataSource
<asp:ObjectDataSource ID="objDataSourceStartAddress" runat="server" SelectMethod="GetSearchStartAddress" TypeName="TransElite.MainApplication.Booking" >
</asp:ObjectDataSource>
Control using ObjectDataSource
<telerik:RadSearchBox runat="server" ID="radtxtSearchStartAddress" EmptyMessage="Search Resolved Address" MinFilterLength="5" OnSearch="radtxtSearchStartAddress_Search" DataTextField="DisplayAddress" DataValueField="Id" DataSourceID="objDataSourceStartAddress" Width="85%">
</telerik:RadSearchBox>
SelectMethod of ObjectDataSource
public List<AddressData> GetSearchStartAddress()
{
// Assigning collection/list to StartSearchAddress
var StartSearchAddress = ClientDataProvider.AddressList(radtxtSearchStartAddress.Text);
return StartSearchAddress;
}
Kindly suggest how to use the control in SelectMethod.