Hello,
I'm working on a custom control. I want to add ej:DropDownList inside formview in custom control. I also want to use a function of code behind as selectMethod. I set custom control class Name into TypeName attribute in ej:DropDownList, but doesn't work. It ends up error.
In my case, data type for binding is from another class from other assembly. Method I use and DataType for bind is in different class.
ObjectDataSource 'obj1' could not find a non-generic method 'eStudio.ucPx.TitleCode_GetItems' that has no parameters.
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ucPx.ascx.vb" Inherits="eStudio.ucPx" %>
<asp:FormView >
<EditTemplate>
<ej:DropDownList ID="TitleCodeDropDownList" runat="server"
DataTextField="ShortDescription"
DataValueField="TitleCode" DataSourceID="obj1" ></ej:DropDownList>
<asp:ObjectDataSourceID="obj1" runat="server" TypeName="eStudio.ucPx" SelectMethod="eStudio.ucPx.TitleCode_GetItems"></asp:ObjectDataSource>
</EditTemplate>
:
:
</asp:FormView >
ucPx.ascx.vb
Partial Public Class ucPx
Inherits UserControlClass
Public Function TitleCode_GetItems() As List(Of DAL.Data.Title)
Using db = New MemberData(Me.User)
Dim q = (From item In db.Titles
Select item).ToList
Return q
End Using
End Function
End Class