web页面 gridview自动刷新的问题
用vs2010自带的ajax控件自动刷新gridview,刚开始测试是成功的,后来系统正式运行后自动刷新失败,贴上前台代码(body块),请各位大神帮忙看看是哪里的问题?还有自动刷新失败是否关系到后台代码?
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="tool">
<table>
<tr>
<td>
</td>
<td id="tooltext">
XXXX
</td>
</tr>
</table>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="1000">
</asp:Timer>
<div style="margin-top:3px">
<asp:GridView ID="gdvRead" runat="server" AutoGenerateColumns="False" CellPadding="1"
ForeColor="#333333" GridLines="None" AllowPaging="True" PageSize="15" Font-Size="11px"
HorizontalAlign="Center" OnRowDataBound="gdvRead_RowDataBound"
>
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:BoundField DataField="code" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:HyperLinkField HeaderText="XX" Text="XX" DataNavigateUrlFields="code" DataNavigateUrlFormatString="QC2_baoyandan_chuli.aspx?id={0}"
Target="iframeMain" NavigateUrl="QC2_baoyandan_chuli.aspx" DataTextField="gongxu">
<ControlStyle Font-Bold="True" Font-Underline="False" />
<ItemStyle Width="200px" />
</asp:HyperLinkField>
<asp:BoundField DataField="changfang" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="neirong" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="320px" />
</asp:BoundField>
<asp:BoundField DataField="leibie" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="180px" />
</asp:BoundField>
<asp:BoundField DataField="qc1time" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="qc1name" HeaderText="QC1" ReadOnly="True">
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:BoundField DataField="qc2name" HeaderText="QC2" ReadOnly="True">
<ItemStyle Width="90px" />
</asp:BoundField>
<asp:BoundField DataField="bulu" HeaderText="补录" ReadOnly="True" Visible="false" />
</Columns>
<RowStyle ForeColor="#333333" HorizontalAlign="Center" BackColor="#F7F6F3"
Height="30px" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"
HorizontalAlign="Center" Height="18px" />
<PagerSettings Visible="False" />
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div id="page">
<asp:LinkButton ID="lnkbtnFrist" runat="server" OnClick="lnkbtnFrist_Click">首页</asp:LinkButton>
<asp:LinkButton ID="lnkbtnPre" runat="server" OnClick="lnkbtnPre_Click">上一页</asp:LinkButton>
<asp:Label ID="lblCurrentPage" runat="server"></asp:Label>
<asp:LinkButton ID="lnkbtnNext" runat="server" OnClick="lnkbtnNext_Click">下一页</asp:LinkButton>
<asp:LinkButton ID="lnkbtnLast" runat="server" OnClick="lnkbtnLast_Click">尾页</asp:LinkButton>
跳转到第<asp:DropDownList ID="ddlCurrentPage" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCurrentPage_SelectedIndexChanged">
</asp:DropDownList>
页 共计<asp:Label ID="labCount" runat="server" Text=""></asp:Label>条数据</div>
</div>
</form>
</body>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="tool">
<table>
<tr>
<td>
</td>
<td id="tooltext">
XXXX
</td>
</tr>
</table>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="1000">
</asp:Timer>
<div style="margin-top:3px">
<asp:GridView ID="gdvRead" runat="server" AutoGenerateColumns="False" CellPadding="1"
ForeColor="#333333" GridLines="None" AllowPaging="True" PageSize="15" Font-Size="11px"
HorizontalAlign="Center" OnRowDataBound="gdvRead_RowDataBound"
>
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:BoundField DataField="code" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:HyperLinkField HeaderText="XX" Text="XX" DataNavigateUrlFields="code" DataNavigateUrlFormatString="QC2_baoyandan_chuli.aspx?id={0}"
Target="iframeMain" NavigateUrl="QC2_baoyandan_chuli.aspx" DataTextField="gongxu">
<ControlStyle Font-Bold="True" Font-Underline="False" />
<ItemStyle Width="200px" />
</asp:HyperLinkField>
<asp:BoundField DataField="changfang" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="neirong" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="320px" />
</asp:BoundField>
<asp:BoundField DataField="leibie" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="180px" />
</asp:BoundField>
<asp:BoundField DataField="qc1time" HeaderText="XX" ReadOnly="True">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="qc1name" HeaderText="QC1" ReadOnly="True">
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:BoundField DataField="qc2name" HeaderText="QC2" ReadOnly="True">
<ItemStyle Width="90px" />
</asp:BoundField>
<asp:BoundField DataField="bulu" HeaderText="补录" ReadOnly="True" Visible="false" />
</Columns>
<RowStyle ForeColor="#333333" HorizontalAlign="Center" BackColor="#F7F6F3"
Height="30px" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"
HorizontalAlign="Center" Height="18px" />
<PagerSettings Visible="False" />
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div id="page">
<asp:LinkButton ID="lnkbtnFrist" runat="server" OnClick="lnkbtnFrist_Click">首页</asp:LinkButton>
<asp:LinkButton ID="lnkbtnPre" runat="server" OnClick="lnkbtnPre_Click">上一页</asp:LinkButton>
<asp:Label ID="lblCurrentPage" runat="server"></asp:Label>
<asp:LinkButton ID="lnkbtnNext" runat="server" OnClick="lnkbtnNext_Click">下一页</asp:LinkButton>
<asp:LinkButton ID="lnkbtnLast" runat="server" OnClick="lnkbtnLast_Click">尾页</asp:LinkButton>
跳转到第<asp:DropDownList ID="ddlCurrentPage" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCurrentPage_SelectedIndexChanged">
</asp:DropDownList>
页 共计<asp:Label ID="labCount" runat="server" Text=""></asp:Label>条数据</div>
</div>
</form>
</body>
...全文
相关推荐
GridView_RowUpdating取不到新值的解决方法
GridView_RowUpdating取不到新值的解决方法,需要的朋友可以参考一下
GridView页面传值技巧揭秘
本文还有配套的精品资源,点击获取 简介:在ASP.NET Web应用开发中,GridView控件用于展示数据库数据。本文深入探讨了如何在用户与GridView交互时,通过多种页面传值技术有效地传递选中行的数据到其他页面或功能模块。包括QueryString、Session、Viewstate、TempData、Form Post、HiddenField等方法的介绍和实现。通...
美化您的Web数据展示:GridView分页样式设计全攻略
GridView控件是.NET框架中常用的数据显示组件,其基本功能是将数据源中的数据以表格形式展示给用户。它支持复杂的数据显示,如分组、排序、编辑、选择等。了解GridView的基本结构和工作原理,对于有效利用其功能至关重要。分页功能是任何网格视图控件中最常见的需求之一,特别是当数据量很大时,它允许用户快速导航到特定的数据页,提高数据管理的效率。
ASP.NET—001:GridView绑定List、页面返回值
文章:http://blog.csdn.net/yysyangyangyangshan/article/details/19016525 如不能解压请联系本人。
GridVIew web端尝试
GridVIew web端尝试 有借鉴意义



