vb vs c# conversion

  • 12 years ago

    can anyone see a problem with the vb version of this code. The C# version works but not the VB.  thanks

    FYI.  The MyClass1 is a C# class. The project works entirely fine in C#. When I convert, this part fails. I don't know C# (yet). 

    C# code next...

    using MyClass1;

    public partial class JQC : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
                AjaxPro.Utility.RegisterTypeForAjax(typeof(MyClass1.GServer));
          
        }
    }

    This is the error preventing the Build:

    Error 3 'GServer' is a type in 'MyClass1' and cannot be used as an expression. 
    VB is next......

    Imports MyClass1

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

            AjaxPro.Utility.RegisterTypeForAjax(Type.GetType(MyClass1.GServer))

        End Sub
    End Class

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Some people, when confronted with a problem, think "I know, I’ll use regular expressions." Now they have two problems.” - Jamie Zawinski