Postback when scrolling a ListBox in chrome

with a list of scrolling lists, the page will refresh (will not).

this problem is only in chrome (version 27). In other browsers, it works correctly.

.aspx file:

<asp:Label runat="server" ID="label1" ></asp:Label>
<asp:ListBox ID="ListBox1" runat="server"
    OnSelectedIndexChanged="ListBox1_SelectedIndexChanged"
    DataValueField="f1" DataTextField="f2" DataSourceID="SqlDataSource1" 
    Rows="15" AutoPostBack="true" >
</asp:ListBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    SelectCommand="sp1" SelectCommandType="StoredProcedure"
    ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>">
</asp:SqlDataSource>

.cs file:

protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    label1.Text = ListBox1.SelectedItem.Text;
}
+5
source share
6 answers

We noticed this unsuccessful error only recently, on a page that worked without problems for a very long time. It is specific to Google Chrome version 27, and I'm currently using version 26.

Error: (clicking anywhere in the control - the scroll bar that is the focus of the problem) causes a full postback [assuming the AutoPostBack attribute is true])

, , . , , , , .

, : 1) : Google Chrome 26. , . , - Chrome.

2) Telerik, RadListBox , , , . , , RadListBox .

, . , , , , . , , , , .

, , . , .

+2

Chrome ( ). Chrome v27.

Chrome : v 27.0.1453.116 , , , ​​ .

+2

AutoPostBack ListBox, onClick ListBox javascript, __doPostBack . . , Google Chrome ( 27 28,...). , AutoPostBack True of ListBox, . TY Pien.

<script type="text/javascript">
function mypostback(id, parameter)
{
  __doPostBack(id, parameter)
}
</script>

<asp:ListBox ID="lstbox_id" runat="server" onclick="mypostback('lstbox_id','')">
</asp:ListBox>
+1

JavaScript mypostback , SelectionMode="Multiple"

+1

All Articles