How to create the Page.Load event code

A

AAaron123

In VB to create the code for a page load event I'd select (Page events) in
the left drop down box and Load in the right drop down box and the code for
the method outline would appear.

I'm guessing it is just a easy in C# but I can't find out how to do it.

Can you tell me how?


Thanks
 
A

AAaron123

I guessed it would be the same.

I'm presently doing asp.net code behind with AutoEventWireup="false"

But I do Windows forms some times.

Are you suggesting that declaring an event is done differently different in
the two disciplines


Thanks
 
M

miher

Hi,
Just select the form/webform, go properties(F4) and look for the small
lightning symbol on the top of the property page, if You press that You can
view the events of the given control, and add event handlers.
Double clicking the form also works for load event.

Hope You find this useful.
-Zsolt
 
A

AAaron123

Thank you
miher said:
Hi,
Just select the form/webform, go properties(F4) and look for the small
lightning symbol on the top of the property page, if You press that You
can view the events of the given control, and add event handlers.
Double clicking the form also works for load event.

Hope You find this useful.
-Zsolt
 
A

AAaron123

Thanks!

Mr. Arnold said:
In Windows form, it is called Form_Load that is wired-up by
double-clicking the form itself, which works the same way in VB and C#
from what I have seen.

On a Web form, the Page_Load is automatically created for you when you
create a new aspx and place it in the solution.

You want a Page_Unload or any other such type of an event dealing with the
page, then you have to put the code there yourself manually, which would
be copy the Page_Load and call it Page_Unload keeping the same signature
as an example.

Web Controls like a Combobox or a Textbox have events that you would use
the Event maker for the control to use a particular event that the control
will use. You drop a control on the form, use the Event maker, see what
it puts in the Code Behind file and see what it puts in the HTML to wire
the event-up for the control.

You should keep in mind that VB.NET is owned and controlled by MS, and
therefore, it is going to have a lot of auto stuff that you can choose and
use. That same functionally may not be in C#, because MS must adhere to a
broader development user base supposedly across platforms with C#. So C#
is not going to have the same fancy bells and whistles that VB.NET has in
it.
 

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