473,378 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Load Event is Raised Twice

Hi

Can anyone explain why the Load Even is raised twice in the web page?

What can be done to avoid it?

Thanks,
Samuel
Jan 22 '07 #1
4 1246
Do you have both automatic event wire-up and explicit server event setting?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:O%****************@TK2MSFTNGP06.phx.gbl...
Hi

Can anyone explain why the Load Even is raised twice in the web page?

What can be done to avoid it?

Thanks,
Samuel

Jan 22 '07 #2
Not sure, where would I set these settings?
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:eA**************@TK2MSFTNGP05.phx.gbl...
Do you have both automatic event wire-up and explicit server event
setting?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:O%****************@TK2MSFTNGP06.phx.gbl...
>Hi

Can anyone explain why the Load Even is raised twice in the web page?

What can be done to avoid it?

Thanks,
Samuel


Jan 22 '07 #3
AutoEventWireup is an attribute in @Page directive. Default value is true.
It wires the server controls to event handling methods with matching names
and signatures. For example, if you have a Page_Load method like this

protected void Page_Load(object sender, EventArgs e)

in the code-behind and AutoEventWireup is true, the method will run as the
Page Load event handler.

If you also setup the events yourself with something like

Load += new EventHandler(Page_Load);

or in any other way, the event will be called twice.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:eb**************@TK2MSFTNGP06.phx.gbl...
Not sure, where would I set these settings?
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:eA**************@TK2MSFTNGP05.phx.gbl...
>Do you have both automatic event wire-up and explicit server event
setting?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:O%****************@TK2MSFTNGP06.phx.gbl...
>>Hi

Can anyone explain why the Load Even is raised twice in the web page?

What can be done to avoid it?

Thanks,
Samuel



Jan 22 '07 #4
Thank you

I am working on an existing project and I will have to check that

Regards,
Samuel
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:OJ**************@TK2MSFTNGP05.phx.gbl...
AutoEventWireup is an attribute in @Page directive. Default value is true.
It wires the server controls to event handling methods with matching names
and signatures. For example, if you have a Page_Load method like this

protected void Page_Load(object sender, EventArgs e)

in the code-behind and AutoEventWireup is true, the method will run as the
Page Load event handler.

If you also setup the events yourself with something like

Load += new EventHandler(Page_Load);

or in any other way, the event will be called twice.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:eb**************@TK2MSFTNGP06.phx.gbl...
>Not sure, where would I set these settings?
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:eA**************@TK2MSFTNGP05.phx.gbl...
>>Do you have both automatic event wire-up and explicit server event
setting?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:O%****************@TK2MSFTNGP06.phx.gbl.. .
Hi

Can anyone explain why the Load Even is raised twice in the web page?

What can be done to avoid it?

Thanks,
Samuel



Jan 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James Lennon | last post by:
Is there an event that is raised that occurrs after a Windows form is displayed for the firt time? The Load event occurrs before the form is displayed for the first time I am looking for an...
8
by: MaryA | last post by:
I have an aspx page that loads twice inspite of using the IsPostBack i removed all controls from the page and still the page_load event is called twice I appriciate any help coz i have lost...
4
by: Kalvin | last post by:
I have seen this question raised, but I cannot find an answer. I have an MDI app, when I load an child form with a combobox being bound in the load event, it won't allow me to set selectedindex =...
3
by: Dennis | last post by:
I have the following code for showing a form: dim frm as new myForm frm.ShowDialog (The Form Load Event is fired then I hide the form using Me.Hide when the X in the UR corner is clicked). ...
1
by: Jason Richmeier | last post by:
I am experiencing some unexpected behavior with the Form Load event in a Windows application. Hopefully, someone can explain why this behavior is occurring. In my application, I have a form...
2
by: Anup | last post by:
Hi Group, In my application I am using a datagrid, now I m implementing sorting for that datagrid, I am changing the flag for ascending and descending when SortCommand event of datagrid is...
0
by: manywolf | last post by:
I have an aspx page that fires the page load event twice for every load. I tried every fix that was suggested in all the posts on this and other forums. None changed the behavior. After one post that...
4
by: chris.c.woodward | last post by:
This event seems to be being raised twice in my codebehind. I have only one SelectMethod and do not have a SelectCountMethod. Its causing a problem because I'm dynamically loading a user control...
4
by: tomb | last post by:
I'm using VB.net 2003 and a FileSystemWatcher. The Changed event gets called twice for every change in the folder I'm watching. To build the functionality, I'm manually changing a text file. As...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.