473,386 Members | 1,801 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,386 software developers and data experts.

aspx pages load twice


Can someone help me try to figure out why my pages load twice? While
debugging other issues, I notice that a great many of my pages run
through the onload method twice, and sometimes they run through the
onclick method of buttons two times as well. As far as onlick is
concerned, I checked the .NET designer code and there is only 1 event
handler wired up, so I don't know why these actions are occuring in
duplicate. Is there a way to trace through and find out why?

--
surveyor04
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #1
4 2170
Most of the time, this is caused by the property AutoEventWireup set to true
instead of false.

S. L.

"surveyor04" <su***************@mail.codecomments.com> wrote in message
news:su***************@mail.codecomments.com...

Can someone help me try to figure out why my pages load twice? While
debugging other issues, I notice that a great many of my pages run
through the onload method twice, and sometimes they run through the
onclick method of buttons two times as well. As far as onlick is
concerned, I checked the .NET designer code and there is only 1 event
handler wired up, so I don't know why these actions are occuring in
duplicate. Is there a way to trace through and find out why?

--
surveyor04
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #2
Are you running with ASP.NET 1.1 sp1?

Microsoft .NET Framework 1.1 Page_Load Event Fires Two Times

http://support.microsoft.com/kb/827801

http://support.microsoft.com/kb/885055
"surveyor04" <su***************@mail.codecomments.com> wrote in message
news:su***************@mail.codecomments.com...

Can someone help me try to figure out why my pages load twice? While
debugging other issues, I notice that a great many of my pages run
through the onload method twice, and sometimes they run through the
onclick method of buttons two times as well. As far as onlick is
concerned, I checked the .NET designer code and there is only 1 event
handler wired up, so I don't know why these actions are occuring in
duplicate. Is there a way to trace through and find out why?

--
surveyor04
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------


Nov 19 '05 #3
I've had large chunks of code execute twice, due to bad programming on my
part.

Sometimes I needed to add a if(!Page.IsPostBack){ ... } wrapper to certain
function calls to make sure they only executed on the intial page load..
other times, I had certain objects or user controls with ViewState enabled
(which is default) but not always necessary and occasionally triggered
unanticpated code execution.
"surveyor04" <su***************@mail.codecomments.com> wrote in message
news:su***************@mail.codecomments.com...

Can someone help me try to figure out why my pages load twice? While
debugging other issues, I notice that a great many of my pages run
through the onload method twice, and sometimes they run through the
onclick method of buttons two times as well. As far as onlick is
concerned, I checked the .NET designer code and there is only 1 event
handler wired up, so I don't know why these actions are occuring in
duplicate. Is there a way to trace through and find out why?

--
surveyor04
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #4
Try setting AutoEventWireup set to false..
Cos i think by default its true.I had the smae problem once but this
fixed it..
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #5

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

Similar topics

3
by: Krzysztof Rozmus | last post by:
Hi, suddenly all pages in my ASP.NET application started to load twice, any idea what's going on ? Chris PS: I have AutoEventWireup="false" on all pages
1
by: JohnSmith | last post by:
I suspect this is easy, but I have been stumped for a day trying to solve this.. I want to be able to have an unlimited number of aspx pages that all use the code in one class file. I want code...
3
by: Evan | last post by:
I have a web page with 2 frames. The left frame is running menu.aspx and the right frame is running images.aspx. When a selection is made in menu.aspx I call a method in images.aspx and pass a...
7
by: J Smithers | last post by:
I have several ASPX pages (with code-behind logic) that I reuse amongst many Web sites on the same production server. Currently each Web site has its own copy of these aspx pages. I was thinking...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
1
by: Carl Gilbert | last post by:
Hi I am trying to get a site working with some 1&1 web space. I have the MS Business Pro account which has ASP.NET Support and SQL Server. I am trying to get an online gallery to work but I...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
0
by: rajendra.mishra | last post by:
Hi... I have a frame(Report.htm) which has two aspx pages one for header(header.aspx) and the other for displaying reports(Report.aspx). when Report.htm is called Report.aspx executes twice. I...
1
by: epower | last post by:
Hello, I am working on an ASP .NET application in Visual Studio 2005 and running IE7. This application has a page that contains an iframe which loads an .aspx page and hyperlinks that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.