asp.net 4.0 Random posting behavior
At work, we are developing a complex webForms app. We are using Visual Studio 2010 to develop a framework 4.0 site in C# 4.0.
We have been experiencing random behavior on 开发者_运维技巧post. Here is what we have seen:
<Button>
tag with a runat server and a ServerClick event will SOMETIMES run the Click event twice (Average 80% twice) - Converted to asp:Button control and it always fired its click event once. So, we called that 'fixed'.
<asp:DropdownList>
control with autopostback=true
. We are seeing similar behavior. We have two UserControls that have an <asp:DropdownList>
with autopostback=true inside. When two of these UserControls are displayed at the same time, If you click one of them, it calls the OnChange event for both DropdownLists. (Average 40% both called)
We have determined that this is not a client side issue. Fiddler 2 shows that we are filling the EventTarget correctly and that both of the DropdownLists' values are correct on post.
At a guess, it seems that the __DoPostBack "part" of asp.net 4.0 has an issue since that is the only thing that these two similar issues shared. Has anyone else seen issues like these and are their any tips/tricks to solve this?
(BTW, converting to a older version is not an option. We are heavily using some of the new features in 4.0)
精彩评论