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

Recommended Answers

All 3 Replies

Hi,

What's the error your reseiving?

Can you post the original code in C#.

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.