C# to VB Translation

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
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?
 
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)
 
Back
Top