AutoEventWireup problem

Q

Quentin Huo

Hi:

This morning I found something wrong in my asp.net application: some pages
and user controls didn't work well. it seems their Page_load method didnot
work. For example if add a statement in the first line in the method
"Page_load": Response.write("hello"); . But nothing showed up when
running the page.

But when I changed the AutoEventWireup to be "true" from "false", they work
well again.

Two things that I cannot understand:

1. I didnot do nothing on system setting, but why they worked well before
this morning, but they didnot work after this morning.

2.why some user controls and pages still work well even I did not change
their AutoEventWireup value from "false" to "true".

Does anybody know what happened?

Thanks

Qing
 
R

Rutger Smit

Quentin said:
Hi:

This morning I found something wrong in my asp.net application: some pages
and user controls didn't work well. it seems their Page_load method didnot
work. For example if add a statement in the first line in the method
"Page_load": Response.write("hello"); . But nothing showed up when
running the page.

But when I changed the AutoEventWireup to be "true" from "false", they work
well again.

Two things that I cannot understand:

1. I didnot do nothing on system setting, but why they worked well before
this morning, but they didnot work after this morning.

2.why some user controls and pages still work well even I did not change
their AutoEventWireup value from "false" to "true".

Does anybody know what happened?

Thanks

Qing

Have you built the website with Visual Studio.NET? Sometimes VS removes
the/some eventhandlers. Don't know why but it's a behavior I've noticed
some times. You can't see it in the output window of VS, evereything
compiles fine and looks like it works fine.

The behavior of AutoEventWireUp in combination with methods like
Page_Load as you described are by design, no need for a explicit
eventhandler in that case.

//Rutger
 

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
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top