Hello people, I am trying to convet the following code from C# to Vb using 3.5 framework.
Here is the code in C# that I am having trouble with.
MethodInfo mi = typeof(Page).GetMethod("LoadControl", new Type[2] { typeof(Type), typeof(object[]) });
I thought it would be like this in VB;
Dim mi As MethodInfo = GetType(Page).GetMethod("LoadControl", New Type(2) {GetType(Type), GetType(Object())})
but I am getting the following error "array initializer is missing 1 elements"
The other line that I am having trouble with and getting the same error is
control = (Control) mi.Invoke(this.Page, new object[2] { ucType, null });
I tried this in vb but it does not work.
control = DirectCast(mi.Invoke(Me.Page, New Object(2) {ucType, Nothing}), Control)
ucType is defined as follows
Dim ucType As Type = Type.[GetType](typeName(1), True, True)
Any help would be greatly appreciated.
Thanks Joe Doc