Visual Basic .NET » ASP.NET General Discussion
Code to VB from C -- bubberz --


hello!
I'm using the AjaxPro.dll and also have the Wrox Professional AJAX book, and am trying to convert the following to VB. My .aspx page is called Ajax1.aspx

public class Ajax1 : System.Web.UI.Page
{
private void Page_Load(...)
{
Ajax.Utility.RegisterTypeForAjax(typeof(Ajax1));
}
}

If I use the following in my VB Page Load:
AjaxPro.Utility.RegisterTypeForAjax(typeof(Ajax1))

...I get the typeof() parameter underlined saying "Ajax1 is a type, and cannot be used in this expression"

If I use:
AjaxPro.Utility.RegisterTypeForAjax(Ajax1)
....I get the same error for the parameter.

My web.config is:
<httpHandlers>
<add verb="POST,GET" path="ajaxpro/*.ashx"
type="AjaxPro.AjaxHandlerFactory, AjaxPro" />
</httpHandlers>

-- JosephGuadagno --



----- Original Message -----
From: "bubberz" <chip>
To: "Ajax.NET Professional" <ajaxpro>
Sent: Monday, July 10, 2006 6:43 AM Subject:
Code to VB from C
In Visual Basic you use the GetType command...

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
AjaxPro.Utility.RegisterTypeForAjax(GetType(AjaxVB.WebForm1))
End Sub

There is a Visual Basic sample application on my website at
http://josephguadagno.net/ajax.aspx 


Joseph Guadagno
http://josephguadagno.net 


hello!
I'm using the AjaxPro.dll and also have the Wrox Professional AJAX
book, and am trying to convert the following to VB. My .aspx page is
called Ajax1.aspx

public class Ajax1 : System.Web.UI.Page
{
private void Page_Load(...)
{
Ajax.Utility.RegisterTypeForAjax(typeof(Ajax1));
}
}

If I use the following in my VB Page Load:
AjaxPro.Utility.RegisterTypeForAjax(typeof(Ajax1))

...I get the typeof() parameter underlined saying "Ajax1 is a type, and
cannot be used in this expression"

If I use:
AjaxPro.Utility.RegisterTypeForAjax(Ajax1)
....I get the same error for the parameter.

My web.config is:
<httpHandlers>
<add verb="POST,GET" path="ajaxpro/*.ashx"
type="AjaxPro.AjaxHandlerFactory, AjaxPro" />
</httpHandlers>
>
 

-- INeedADip --


I believe you are looking for GetType() instead of typeof()

-- bubberz --


Thanks INeedADip!

that was it!

[Submit Comment]Home