converting vb.net to c# help

S

Steve

I am trying to convert this piece of code to c# from
vb.net. Does anyone have any ideas?

Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
 
N

Nicholas Paldino [.NET/C# MVP]

Steve,

You can do this:

private void Page_Load(object sender, EventArgs e)

However, that is only part of it. You will have to create the delegate
and assign the method, like this:

Load += new EventHandler(this.Page_Load);

This should be done in the InitializeComponent method on your Page class
(if the designer was the one that created it).

Hope this helps.
 

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

Top