【发布时间】:2013-01-04 07:48:55
【问题描述】:
我有一个用于整个页面的更新面板。当我单击链接时,会出现相应的更新面板并显示一个网格视图。一旦用户更新网格并单击提交按钮,网格视图就会更新为最新数据。但问题是面板尺寸增加并且网格已经移向页面底部。
<tr>
<td>
<asp:UpdatePanel ID="updatePanelMenu" runat="server">
<ContentTemplate>
<table>
<tr>
<asp:Panel ID="pnlNeedApproval" Visible="false" runat="server" Height="480px" Width="800px" >
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width: 665px">
<asp:UpdatePanel ID="updatePanelApproval" runat="server">
<ContentTemplate>
<table class="EditTemplate" width="100%">
<tr>
<td colspan="6" align="center">
<div id="Div9" style="width:800px;HEIGHT:450px">
<igtbl:UltraWebGrid ID="uwgApproval" runat="server"
DisplayLayout-AutoGenerateColumns="false" Width="800px"
DataKeyField="Approval_log_ID" OnInitializeRow="uwgApproval_InitializeRow">
<Bands>
<igtbl:UltraGridBand AllowUpdate="Yes"
FixedHeaderIndicator="Button" AllowRowNumbering="Continuous"
BaseTableName="Approval_log" DataKeyField="Approval_log_ID" SortingAlgorithm="QuickSort">
<Columns>
<igtbl:UltraGridColumn BaseColumnName="Approval_log_ID" Hidden="True" Key="Approval_log_ID" DataType="System.Int32">
<Header Caption="Approval_log_ID"></Header>
</igtbl:UltraGridColumn>
<igtbl:TemplatedColumn AllowUpdate="Yes" Type="DropDownList" BaseColumnName="Approval_Status" Key="Approval_Status" >
<HeaderTemplate>
<div nowrap>Approve/Reject</div>
</HeaderTemplate>
<CellTemplate>
<asp:DropDownList ID="cboApprovalStatus" Width="110px" runat="server" onchange="SetApprovalStatus(this);">
<asp:ListItem value="2"><--Select One--></asp:ListItem>
<asp:ListItem value="0">Reject</asp:ListItem>
<asp:ListItem value="1">Approve</asp:ListItem>
</asp:DropDownList>
</CellTemplate>
</igtbl:TemplatedColumn>
<igtbl:UltraGridColumn BaseColumnName="APPROVAL_TYPE" Key="APPROVAL_TYPE" Hidden="true">
<Header Caption="Type">
<RowLayoutColumnInfo OriginX="1" />
</Header>
<Footer>
<RowLayoutColumnInfo OriginX="1" />
</Footer>
</igtbl:UltraGridColumn>
<igtbl:UltraGridColumn BaseColumnName="Assigned_By" Key="Assigned_By" Hidden="true">
<Header Caption="Assigned_By"></Header>
</igtbl:UltraGridColumn>
<igtbl:UltraGridColumn BaseColumnName="CommonKey" Key="CommonKey" Hidden="true">
<Header Caption="CommonKey"></Header>
</igtbl:UltraGridColumn>
</Columns>
</igtbl:UltraGridBand>
</Bands>
</igtbl:UltraWebGrid>
</div>
</td>
</tr>
<tr>
<td colspan="6" align="center">
<asp:Button ID="btnApprovalSubmit" CssClass="inputbut" OnClick="btnApprovalSubmit_serverclick" runat="server" Text="Submit" ></asp:Button>
<asp:Button ID="btnApprovalReset" CssClass="inputbut" OnClick="btnApprovalReset_serverclick" runat="server" Text="Reset" ></asp:Button>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Panel>
【问题讨论】:
-
把你的代码放在这里。提问时要更加具体。阅读faq 和How to Ask
-
我的问题是虽然功能正常,但设计 collpases.Grid 应该固定在更新前最初所在的顶部。
-
你的 html 有问题你有两个UpdatePanel,一个就够了,把里面的UpdatePanel去掉再试一次。@Aristos:正如你所说,我将整个页面的更新面板属性更改为 updatemode=conditional。现在它工作正常。谢谢。
标签: c# asp.net ajax asp.net-ajax updatepanel