C# to VB Translation

J

Jim Heavey

I found and example on the web where a event for a customValidator is being
loaded in code. It looks like the following..

this.CustomValidator1.ServerValidate +=
new System.Web.UI.WebControls.ServerValidateEventHandler(
this.CustomValidator1_ServerValidate);
this.Load += new System.EventHandler(this.Page_Load);

I thought the translation for "this" in "Vb.Net was "Me", but when I make
the substitution, it does not translate correctly. What is the translation
of this to VB.Net?
 
F

Frank Oquendo

Jim said:
I found and example on the web where a event for a customValidator is
being loaded in code. It looks like the following..

this.CustomValidator1.ServerValidate +=
new System.Web.UI.WebControls.ServerValidateEventHandler(
this.CustomValidator1_ServerValidate);

You could just add 'Handles CustomValidator1.ServerValidate' to the
signature of your event handling code.

If you'd prefer to use AddHandler, this should do it (watch for word
wrap):

AddHandler CustomValidator1.ServerValidate, AddressOf
CustomValidator1_ServerValidate

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top