Home update panel is updating entire page instead of just grid view
Reply: 0

update panel is updating entire page instead of just grid view

user2939 Published in March 20, 2018, 3:28 pm

I'm trying to use an ajax timer and a update panel to update only my gridview, but it keeps resetting the entire page. What am I doing wrong? Here is my code.

aspx page:

        <div class="row text-center">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <asp:PostBackTrigger ControlID="gvShowContent" />
                <asp:Timer ID="Timer1" runat="server" Interval="60000" OnTick="Timer1_Tick"></asp:Timer>
                <asp:GridView ID="gvShowContent" runat="server" OnRowCommand="gvShowContent_RowCommand" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None">
                    <AlternatingRowStyle BackColor="White" />
                        <asp:BoundField DataField="Course_Code" HeaderText="Course Code" />
                        <asp:BoundField DataField="Content_Name" HeaderText="Title" />
                        <asp:BoundField DataField="Content_Description" HeaderText="Description" />
                        <asp:BoundField DataField="Content_Title" HeaderText="File Name" />
                        <asp:TemplateField HeaderText="Download">
                                <asp:LinkButton ID="lnkDownload" runat="server" CommandArgument='<%# Eval("Content_Title") %>' CommandName="cmd">Download</asp:LinkButton>
                    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                    <SortedAscendingCellStyle BackColor="#FDF5AC" />
                    <SortedAscendingHeaderStyle BackColor="#4D0000" />
                    <SortedDescendingCellStyle BackColor="#FCF6C0" />
                    <SortedDescendingHeaderStyle BackColor="#820000" />


protected void Timer1_Tick(object sender, EventArgs e)
        gvShowContent.DataSource = proxy.ShowContent();
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.414336 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO