【发布时间】:2015-01-29 01:15:04
【问题描述】:
我正在开发一个使用母版页的 asp 网站。
我正在努力的页面结构如下:
<asp:UpdatePanel ID="MainUpdatePanel" runat="server">
<ContentTemplate>
<asp:Panel ID="Panel3" runat="server" CssClass="Panel">
<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="gridpanel" runat="server" Visible="false" ClientIDMode="Static">
<asp:GridView ID="grdCombinedTransactions" runat="server" PageSize="40" AllowPaging="True" AllowSorting="true" etc etc >
<asp:TemplateField HeaderText="GL Account" >
<ItemTemplate>
<asp:TextBox ID="txtGLAccount" runat="server" Text='<%# Bind("GLAccount") %>' CssClass="txtGLAccount" OnTextChanged="txtGLAccount_TextChanged" AutoPostBack="true"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</asp:GridView>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
MainUpdatePanel 内还有其他带有其他更新面板的面板,但这是我遇到的问题,特别是 GridView。
txtGLAccount 字段在其文本更改时会导致回发。此 PostBack 滚动页面,使 txtGLAccount 字段位于页面底部。
我想阻止任何类型的滚动,因为这种行为看起来很“跳跃”,并且会破坏此页面的数据输入工作流程。
这可能吗?
谢谢!
【问题讨论】:
标签: c# jquery asp.net webforms