IBindableTemplate : Help

G

Guest

Hello,
What is wrong with this template below?.

I get this error: "Class 'MyEditFormTemplate' must implement 'Function
ExtractValues(container As Control) As
Collections.Specialized.IOrderedDictionary' for interface
'System.Web.UI.IBindableTemplate'.

***************************
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Collections.Specialized
Imports System.Collections

Public Class MyEditFormTemplate
Implements IBindableTemplate

Public Function ExtractValues(ByVal container As Control) As
System.Collections.Specialized.IOrderedDictionary
Dim od As OrderedDictionary = New OrderedDictionary
Return od
End Function

Public Sub InstantiateIn(ByVal container As Control) Implements
ITemplate.InstantiateIn
Dim tb1 As TextBox = New TextBox
tb1.ID = "MyTextBox"
container.Controls.Add(tb1)
End Sub

End Class
***************************

Thanks,
Ganesh
 
G

Guest

But if I modify that as below, I get an error saying "Type Expected"..

Please help.

Public Function ExtractValues(ByVal container As Control) Implements
System.Collections.Specialized.IOrderedDictionary()
Dim od As OrderedDictionary = New OrderedDictionary
Return od
End Function

Thanks,
Ganesh
 
G

Gozirra

Don't know if you resolved this or not but I believe the problem is
that you need to specify the return type as shown below. If you did
figure this out already I apologize for not getting back sooner.

Public Function ExtractValues(ByVal container As Control) As
OrderedDictionary Implements
System.Collections.Specialized.IOrderedDictionary()
Dim od As OrderedDictionary = New OrderedDictionary
Return od
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top