Page_Load of User Control Does not fire

V

Vivek

Hi,

I am using VStudio 2002 (Professional). I created a User
control that displays the banner of my application. I
assign the images of the banner in the Page_Load method of
the user control. But when I run the application the
Page_Load method of the control is not run. I tried
putting a breakpoint on a line in the method but at run
time the break point is not hit.

What am I missing. Something in the web.config?

Thanks,
Vivek
 
J

James J. Foster

Assuming you are using Code Behind, ensure that the Event Handler has been
set up. I've encountered instances where VS.NET mysteriously removes it. It
should look something like this in the collapsed Web Form Designer Generated
Code section.

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
 
V

Vivek

Thanks James. It did work.
-----Original Message-----
Assuming you are using Code Behind, ensure that the Event Handler has been
set up. I've encountered instances where VS.NET mysteriously removes it. It
should look something like this in the collapsed Web Form Designer Generated
Code section.

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}

--
James J. Foster, DotNetCoders
http://www.dotnetcoders.com





.
 

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

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top