3

I have a UserControl with an UpdatePanel in it. Within the update panel is a DropDownList. When the section is changed, a DataList is loaded and a submit button is made visible. The submit button works fine in IE and FireFox but in Chrome, it intermittently appears to do nothing (that is, many times it works fine in Chrome). When it does not work, the asp.net ajax UpdateProgress template for the update panel does not display and there is not post back to the server. The UpdatePanel has ChildrenAsTriggers=true and the button is a child. The button is enabled and I'm not getting any script errors in the Chrome developer tools console. I also get no server side exceptions at any point. There is no custom javascript attatched to the button:

<asp:Button ID="btnContinue" runat="server" Text="" CssClass="btn_continue" OnClick="btnCheckOut_Click" />

How can I further debug what's happening (or not happening) when I click the button?

Edit: Here's some new info:

1) When the problem occurs, no subsequent postbacks work. I select an item from the drop down list, it posts back asynchronously, and then neither the button nor changing the drop down list selection again causes a postback.

2) I've found that when I experience the problem, I can go to Tools>Clear Browsing Data and check only "Empty The Cache" and clear it, then reload page and the problem goes away. I can't reproduce it until I log out and come back to the page. So it seems to be cache related.

3) Multiple postbacks seem to work fine without the UpdatePanel.

Edit2: This is running in SharePoint 2007 which is apparently an important factor. The masterpage uses a sharepoint script INIT.JS in it's body OnLoad and form OnSubmit events to do some stuff. One thing it does is sets a flag indicating whether the form has been submitted and set's it back to false in OnLoad. The OnLoad function also basically bypasses that process for ajax postbacks. The problem is Chrome is not executing the OnLoad event so that process does not get bypassed, the flag never gets set back to false, and successive submissions are denied by the OnSubmit function. I've got a thread exploring that issue here: http://social.msdn.microsoft.com/Forums/en-ca/sharepointgeneral/thread/97ff77d1-31d4-45ff-af6e-524416cdff1c

xr280xr
  • 12,621
  • 7
  • 81
  • 125
  • Too bad that you omitted such crucial info that app is built on top of MOSS. You would get answers faster if you provide all info about the problem. – Tomas Voracek Oct 14 '11 at 19:45
  • Ya, it may have been helpful if I realized the problem was specific to SharePoint. However, my question was not how to fix the bug, but how to troubleshoot the bug. The answer to that question is what led me to narrowing it down to include SharePoint as a culprit. There's probably a couple thousand other details I could include about the environment, the hardware, and the software involved that could've potentially been relevent info before knowing what IS relevant to the bug. The fact that including "all info" would result in a book is, in fact, why I chose to ask about troubleshooting steps. – xr280xr Oct 17 '11 at 18:46
  • I apologize for offending you, it was not my intention. I have some pretty funny experience with MOSS too, finding after hours that not asp, not my script, but something somewhere in MOSS is a culprit. – Tomas Voracek Oct 17 '11 at 19:16

2 Answers2

0

I always recommend Fiddler for debugging http traffic.

Tomas Voracek
  • 5,886
  • 1
  • 25
  • 41
  • I'll double check using Fiddler, but I believe it's not posting so there is no HTTP traffic – xr280xr Oct 10 '11 at 21:54
  • 1
    @xr280xr Maybe http://stackoverflow.com/questions/508994/asp-net-dropdownlist-autopostback-and-google-chrome? – Tomas Voracek Oct 10 '11 at 22:02
  • thanks that's good to know. I tried it out and verified it's running but it didn't help with this problem. I added some new info to my original post above. – xr280xr Oct 11 '11 at 19:43
0

You can debug the problem futher using the built in Chrome developer tools. Although the form is not being posted, there is client side script running. Click the wrench button>Tools>Developer Tools, or press ctrl+shift+I. Use the Script tab to debug javascript. Although the button might not have any javascript associated with it, the form may have an OnSubmit script. You can set a breakpoint on that script. Since the auto postback DropDownList was also not working, you can set breakpoints on the OnChanged event. The ajax script manager automatically inserts a setTimeout script in the OnChanged event so one way to catch it is to select the Event Listener Breakpoints expander on the right side of the Scripts pane, expand timer, and check the Timer Fired event. Or you can search the ScriptResource.axd file(s) for the function Sys$WebForms$PageRequestManager$_doPostBack(eventTarget, eventArgument) and set a breakpoint there, but this might require the next step...

Getting it to break is one thing, but having a readable script is another. The ajax scripts are not very helpful by default, but if you change your site's web.config to use

<compilation Debug="true">.

This will load a more readable debug version of the ajax scripts that you can step through.

xr280xr
  • 12,621
  • 7
  • 81
  • 125