473,661 Members | 2,431 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug causes double postback

My environment. .Net 2.0 VS2k5 SP1, IE6 (6.0.2900.2180)

I have a web content page. The page will post back twice if I am running in
debug mode. However if I run through the breakpoints fast enough the page
will not post back twice.

I have disabled Google Popup blocker, windows firewall, a soap collector
service.

Something wierd with IE is if I sit in debug long enough the page will go
blank and the status bar will say something along the lines of "Looking for
localhost".

If I run through the breakpoints fast enough, and the blank IE page never
shows up, then the double postback doesn't occur.

It seems as if IE is automatically posting back if the request is taking too
long.

What can I do?
--
Mike Logan
Jul 2 '07 #1
7 7001
Mike,
It sounds to me like you either have some errant "meta - refresh" tag or
script in the page, or you have caught some malware. For number two, get
windows defender and run a deep scan.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder( BETA): http://www.blogmetafinder.com

"Mike Logan" wrote:
My environment. .Net 2.0 VS2k5 SP1, IE6 (6.0.2900.2180)

I have a web content page. The page will post back twice if I am running in
debug mode. However if I run through the breakpoints fast enough the page
will not post back twice.

I have disabled Google Popup blocker, windows firewall, a soap collector
service.

Something wierd with IE is if I sit in debug long enough the page will go
blank and the status bar will say something along the lines of "Looking for
localhost".

If I run through the breakpoints fast enough, and the blank IE page never
shows up, then the double postback doesn't occur.

It seems as if IE is automatically posting back if the request is taking too
long.

What can I do?
--
Mike Logan
Jul 2 '07 #2
Hi Mike,

Based on your description, I think the double postback issue is actually
occuring when your server-side code will block/wait for a while rather than
execute immediately, so the "under debugging mode" is only a condition
which trigger this cause.

For ASP.NET web page double postback, I've also met some similar issues
before and here are some of the causes:

** Some html markup (such as the meta fresh tag or a <imgor css image
style ) that point to the page itself which cause an additional get postback

** certain server-side event handler be registered twice(usually in vb.net
web page)

** some control may cause postback event be submit twice(the SubmitButton
which configured as image style...)

for your scenario, I think one possible cause is your page's response will
write out some certain html tag that cause a new request to the page
itself. Since it will occur when you wait a while at server-side(such as
break at debugger), maybe at that time, the markup is send back to client
and the browser send a new request). You can check the following things to
further verify the behavior:

1) Check IIS log on the server and see what kind of request is the second
duplicated one(get or post)

2) Check whether all the page events are executed twice or only the
particular postback event

If you have any other finding, please also feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 3 '07 #3
Hello Steven,

I checked the IIS logs. Here is what I saw in the first pass:

10:06:45 127.0.0.1 GET /Application1/Page1.aspx 401
10:06:54 127.0.0.1 GET /Application1/Page1.aspx 200
10:06:57 127.0.0.1 POST /FormService/FormService.asm x 200
10:07:03 127.0.0.1 GET /css/css1.css 404
10:07:03 127.0.0.1 GET /Application1/Page1.aspx 200
10:07:07 127.0.0.1 DEBUG /Application1/NewForm.aspx 200

I saw the 404 for the CSS file, I know where it is occurring...rem oving it
from the page. Tried again and go this.

10:37:01 127.0.0.1 GET /Application1/Page1.aspx 401
10:37:07 127.0.0.1 GET /Application1/Page1.aspx 200
10:37:11 127.0.0.1 POST /TestService/TestService.asm x 200
10:37:18 127.0.0.1 GET
/Application1/PetersDatePacka ge/Appearance/stylesheet1.css 401
10:37:18 127.0.0.1 GET
/Application1/PetersDatePacka ge/Appearance/stylesheet1.css 304
10:37:18 127.0.0.1 GET /Application1/Page1.aspx 200
10:37:18 127.0.0.1 GET /Application1/PetersDatePacka ge/1_1_12/PDP_Globals.js
304
10:37:18 127.0.0.1 GET /Application1/PetersDatePacka ge/1_1_12/DateTextBox.js
304
10:37:18 127.0.0.1 GET /Application1/PetersDatePacka ge/1_1_12/CSCalendar.js
304
10:37:18 127.0.0.1 GET
/Application1/PetersDatePacka ge/1_1_12/CSMonthPicker.j s 304
10:37:18 127.0.0.1 GET /Application1/PetersDatePacka ge/1_1_12/CS_Menu.js 304
If I run through fast enough on the page, the page load event is only fired
once. However it seems like if I don't get my debugging done before the IE
screen goes blank and the status bar changes to the "searching for localhost"
then the page load event is hit twice.

When you say Page Events....do you mean true page events like Init Load,
Render?

Also, just as an fyi, I am registering to a published event on a web
control. The web control has buttons on it and I am doing the processing for
them on the hosting page. Code is below.

Private Sub Page1_Init(ByVa l sender As Object, ByVal e As System.EventArg s)
Handles Me.Init
AddHandler WebControl1.Act ionClickEvent, AddressOf OnFormAction
End Sub

--
Mike Logan
"Steven Cheng[MSFT]" wrote:
Hi Mike,

Based on your description, I think the double postback issue is actually
occuring when your server-side code will block/wait for a while rather than
execute immediately, so the "under debugging mode" is only a condition
which trigger this cause.

For ASP.NET web page double postback, I've also met some similar issues
before and here are some of the causes:

** Some html markup (such as the meta fresh tag or a <imgor css image
style ) that point to the page itself which cause an additional get postback

** certain server-side event handler be registered twice(usually in vb.net
web page)

** some control may cause postback event be submit twice(the SubmitButton
which configured as image style...)

for your scenario, I think one possible cause is your page's response will
write out some certain html tag that cause a new request to the page
itself. Since it will occur when you wait a while at server-side(such as
break at debugger), maybe at that time, the markup is send back to client
and the browser send a new request). You can check the following things to
further verify the behavior:

1) Check IIS log on the server and see what kind of request is the second
duplicated one(get or post)

2) Check whether all the page events are executed twice or only the
particular postback event

If you have any other finding, please also feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 3 '07 #4
Hello Peter,

I checked for meta-refresh tags but there where none.
--
Mike Logan
"Peter Bromberg [C# MVP]" wrote:
Mike,
It sounds to me like you either have some errant "meta - refresh" tag or
script in the page, or you have caught some malware. For number two, get
windows defender and run a deep scan.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder( BETA): http://www.blogmetafinder.com

"Mike Logan" wrote:
My environment. .Net 2.0 VS2k5 SP1, IE6 (6.0.2900.2180)

I have a web content page. The page will post back twice if I am running in
debug mode. However if I run through the breakpoints fast enough the page
will not post back twice.

I have disabled Google Popup blocker, windows firewall, a soap collector
service.

Something wierd with IE is if I sit in debug long enough the page will go
blank and the status bar will say something along the lines of "Looking for
localhost".

If I run through the breakpoints fast enough, and the blank IE page never
shows up, then the double postback doesn't occur.

It seems as if IE is automatically posting back if the request is taking too
long.

What can I do?
--
Mike Logan
Jul 3 '07 #5
You could possibly have "AutoEventWireU p="true" in your ASPX @Page
declaration, plus a specific additional event handler defined. Remove the
"AutoeventWireu p" if present and test your page.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder( BETA): http://www.blogmetafinder.com

"Mike Logan" wrote:
My environment. .Net 2.0 VS2k5 SP1, IE6 (6.0.2900.2180)

I have a web content page. The page will post back twice if I am running in
debug mode. However if I run through the breakpoints fast enough the page
will not post back twice.

I have disabled Google Popup blocker, windows firewall, a soap collector
service.

Something wierd with IE is if I sit in debug long enough the page will go
blank and the status bar will say something along the lines of "Looking for
localhost".

If I run through the breakpoints fast enough, and the blank IE page never
shows up, then the double postback doesn't occur.

It seems as if IE is automatically posting back if the request is taking too
long.

What can I do?
--
Mike Logan
Jul 3 '07 #6
Thanks for your reply Mike,

so "Page1.aspx " is the one in problem, right? From the log you provided,
there are only multiple "get" requests, so the double "Page_load" occurs
at the first load of the page?

Yes, the page events I mentioned earlier means those standard built-in Page
events(Init, Load, Prerender....).

I'm still quite interested in the "browser turn to blank behavior", not
sure whether it is caused by client-side browser or some html element
flushed from server-side. I'd like to perform some test on my local side,
if the problem does be caused by some element flushed by server-side page,
it should be reproable on my side. Would you try make a simplified page
that can repro the problem and send it to me? You can reach me through the
email in my signature(remov e "online" in it).

Looking forward to your reply.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 5 '07 #7
Hi Mike,

Have you got any further progress on this issue? If there is still
anything need help, please don't hesitate to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 9 '07 #8

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

Similar topics

0
1546
by: Xavier Osa | last post by:
Hi, I have an ASP.Net web page that you can download a file. As Fergunson's problem, it prompts twice dialog boxes only if I select Open button. If I select Save button, it prompts once. I'm using W2000KS & IE6 sp1 & VS.NET 2003. If I change method="post" by method="get" form attribute, it works fine.
0
1501
by: Tony Hedge | last post by:
Hello, I can briefly explain without providing any code, it's a simple NET 1.1 web project. I have a web form with a textbox A and button A (in a table row), and textbox B and button B (in a second table row). The textboxes are of type asp:Textbox and buttons are asp:Button. Autopostback=false for textboxes. Click event used for the buttons. When user types in text in textbox B and hits Enter, the click event for
0
1055
by: Petr PALAS | last post by:
Hi, we've experienced the following problem with ASP.NET 1.1 on Windows Server 2003 and Internet Explorer 6.0: When user submits a form, nothing happens or two posts are sent to the server. It happens only sometimes and on some machines. The code seems to be correct since it works/doesn't work with the same data and after the same steps and it doesn't happen at all on our development
4
2881
by: peshrad | last post by:
Hi ! I'm working with Win 2K and Visual Studio 2003. I have a problem because pressing <ENTER> in a text input control causes a postback of my web form. Here comes some example code (already stripped of most of the unnecessary code): ----------------------------------------------------------------------------
8
1909
by: Tim_Mac | last post by:
Hello, this message was posted in december 2005 and Steven Cheng from MS followed it up with me to a point, before the thread trailed off. http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_frm/thread/47281f5d53c14950 several other newsgroup users have since confirmed the bug/behaviour described, and it is very easy to reproduce. There is a hack/workaround but it is very unsatisfactory, and this will continue...
2
1878
by: dwclark | last post by:
Hi all, The issue I'm having is when a control is fired and causes a post back, the page actually refreshes twice. Once as a postback and the second time is not. I created a simple aspx page with one button and in the Page_Load section did a System.Diagnostics.Trace.WriteLine(IsPostBack). When I click the button, i get True and then False in my Output window. Does anyone have an answer?
0
1346
by: Dave | last post by:
Hi, I'm trying to download a pdf from a secure location and writ e the response to the browser as listed below. However, the form that runs this codes appears to postback when I encounter the Response.OutputStream??? WebClient client = new WebClient(); client.Credentials = new NetworkCredential("username", "password"); byte pdfBytes = client.DownloadData(strUrl); Response.ContentType = "application/pdf";...
5
4767
by: I.Katzav | last post by:
Hi, I have a page in which I encounter the following behaviour: when triggering a server event that should normally only post back once, it actualy posts back twice in some of the times. some other times it calls the page as though it isn't a post back and immediatly after that it calls the page - this time as a postback with the page viewstate. this causes some sequences that should only occure once to be executed, and data becomes...
1
1909
by: Mufasa | last post by:
I have a datagrid where in the item template I have a button. No matter what I put in the button, I get the dreaded Invalid Posterback or Callback Argument error. Any ideas on how to fix it? TIA - J.
0
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8758
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7364
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.