0

Hi
I using C# to VB.NET code converter which gave me this:

Public Class PostCalendar
        Inherits Calendar
        [B]Implements [U]ICallbackEventHandler[/U][/B]
//--Class 'PostCalendar' must implement 'Function GetCallbackResult() As String' for interface 'System.Web.UI.ICallbackEventHandler'. ¿¿??

//-----------------------------------------------

Shared Sub New()
	[B][U]Post.Saved += Post_Saved[/U][/B]
End Sub

//-----------------------------------------------

Public Class RecentComments
		Inherits Control

		Shared Sub New()
			[B]BindComments()
			[U]Post.CommentAdded += Function() Do[/U]
				[U]BindComments()[/U]
			[U]End Function[/U]
			[U]Post.CommentRemoved += Function() Do[/U]
				[U]BindComments()[/U]
			[U]End Function[/U]
			[U]Post.Saved += New EventHandler(Of SavedEventArgs)(Post_Saved)[/U]
			[U]Comment.Approved += Function() Do[/U]
				[U]BindComments()[/U]
			[U]End Function[/U]
			[U]BlogSettings.Changed += Function() Do[/U]
				[U]BindComments()[/U]
			[U]End Function[/U][/B]
		End Sub

//----------------------------
                 Shared Sub New()
			[B][U][U]Post.Saved += Function() Do[/U]
				[U]_WeightedList = Nothing[/U][/B]
			[U]End Function[/U]
		End Sub

Which on build in visual studio 2008 gives an error.

Please help me

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Luc001
0

Hi,

What's the error your reseiving?

Can you post the original code in C#.

Edited by Luc001: n/a

0
public class PostCalendar : Calendar, [B]ICallbackEventHandler[/B]
	{

	static MonthList()
		{
			Post.Saved += Post_Saved;
		}
//-------------

public class RecentComments : Control
	{

		static RecentComments()
		{
			BindComments();
			Post.CommentAdded += delegate { BindComments(); };
			Post.CommentRemoved += delegate { BindComments(); };
			Post.Saved += new EventHandler<SavedEventArgs>(Post_Saved);
			Comment.Approved += delegate { BindComments(); };
			BlogSettings.Changed += delegate { BindComments(); };
		}
 public class TagCloud : Control
  {

    static TagCloud()
    {
      Post.Saved += delegate { _WeightedList = null; };
    }

I have some errors in VB.NET
1. Class 'PostCalendar' must implement 'Function GetCallbackResult() As String' for interface 'System.Web.UI.ICallbackEventHandler'.

2. Declaration expected.

Thanks for your interest

0

Hi,

I've tryed to convert your code.
Here's the result:

Public Class PostCalendar    
Inherits Calendar
   Implements ICallbackEventHandler
    
    Shared Sub New()
        Post.Saved += Post_Saved
    End Sub
    
    Public Class RecentComments
        Inherits Control
        
        Shared Sub New()
            BindComments()
            Post.CommentAdded += Function() Do
                BindComments()
            End Function
           Post.CommentRemoved += Function() Do
                BindComments()
            End Function
            AddHandler Post.Saved, AddressOf Post_Saved            
Comment.Approved += Function() Do
                BindComments()
            End Function
            BlogSettings.Changed += Function() Do
                BindComments()
           End Function
       End Sub
        Public Class TagCloud
           Inherits Control
           
            Shared Sub New()
               Post.Saved += Function() Do
                   _WeightedList = Nothing
               End Function
           End Sub
       End Class
    End Class
End Class

I couldn't test it, but I hope it will do.

This article has been dead for over six months. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.