0

We have a DropDownList inside an UpdatePanel whose autopostback property is set to true. We have kept a statement in triggers that Postback is asynchronous postback, and we have the handler of the dropdown in our code behind.

There is a peculiar issue that the event is not getting fired on some machines. We have also included InitializeRequest, and there we have checked with the ID on which the postback occured. It was showing empty in one machine, and the same is working in another machine without any issue.

Is this issue a browser Issue or any other issue? We are unable to know why such kind of issue occurs as the same piece of code is working on some machines.

<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDown1" EventName="SelectedIndexChanged" /> 
</Triggers>
<ContentTemplate>
<asp:DropDownList ID=" DropDown1" runat="server" AutoPostBack="true"> </asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel> 

Private Sub DropDown1_SelectedIndexChanged(default args)Handles DropDown1.SelectedIndexChanged End Sub function InitializeRequest(sender,args){ 
if (args.get_postBackElement().id == '<%= DropDown1.ClientID %>'){ }
}
Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
Phani
  • 1
  • ASPX Code Private Sub DropDown1_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DropDown1.SelectedIndexChanged End Sub – Phani Aug 29 '13 at 12:06
  • Private Sub DropDown1_SelectedIndexChanged(default args)Handles DropDown1.SelectedIndexChanged End Sub function InitializeRequest(sender,args){ if (args.get_postBackElement().id == '<%= DropDown1.ClientID %>'){ }} – Phani Aug 29 '13 at 12:12
  • Add this OnTextChanged="DropDown1_SelectedIndexChanged" AutoPostBack="true" – Arun Banik Sep 04 '13 at 11:52

1 Answers1

0

You don't need AsyncPostBackTrigger for controls inside Update Panel. Controls declared inside an update panel will trigger an asynchronous call by default. Remove this line:

<asp:AsyncPostBackTrigger ControlID="DropDown1" EventName="SelectedIndexChanged" /> 

For better understanding I suggest reading AsyncPostBackTrigger vs PostBackTrigger and What is the different between AsyncPostBackTrigger & PostBackTrigger really?.

Community
  • 1
  • 1
afzalulh
  • 7,925
  • 2
  • 26
  • 37
  • Issue got resolved. The solution file got corrupted because of which it is behaving in this way. Ya i agree that the said line is not required to be written. Thanks for the suggestion but even if we keep that line there is no issue. – Phani Aug 30 '13 at 04:50