與滾動列表框,頁面將刷新(不需要)。回滾時滾動列表框在鉻版
此問題僅適用於Chrome(版本27)。在其他瀏覽器中,它可以正常工作。
.aspx文件:
<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文件:
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
label1.Text = ListBox1.SelectedItem.Text;
}
版本27是非常早期的測試版 - 可能是一個鉻的bug? - 畢竟你有自動回覆。 – Aristos 2013-03-07 00:03:34
如果將'AutoPostBack =「true」'設置爲'false',它是否仍然會發生? – Brian 2013-03-07 00:06:32
如果你有舊版本的Chrome,請檢查一下。 – sohrab 2013-03-07 00:12:03