IBindableTemplate : Help

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top