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

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 6983
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.asmx 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...removing 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.asmx 200
10:37:18 127.0.0.1 GET
/Application1/PetersDatePackage/Appearance/stylesheet1.css 401
10:37:18 127.0.0.1 GET
/Application1/PetersDatePackage/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/PetersDatePackage/1_1_12/PDP_Globals.js
304
10:37:18 127.0.0.1 GET /Application1/PetersDatePackage/1_1_12/DateTextBox.js
304
10:37:18 127.0.0.1 GET /Application1/PetersDatePackage/1_1_12/CSCalendar.js
304
10:37:18 127.0.0.1 GET
/Application1/PetersDatePackage/1_1_12/CSMonthPicker.js 304
10:37:18 127.0.0.1 GET /Application1/PetersDatePackage/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(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Init
AddHandler WebControl1.ActionClickEvent, 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 "AutoEventWireUp="true" in your ASPX @Page
declaration, plus a specific additional event handler defined. Remove the
"AutoeventWireup" 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(remove "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
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...
0
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...
0
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....
4
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...
8
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. ...
2
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...
0
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...
5
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...
1
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? ...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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:
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.