Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 13th, 2009, 09:40 AM
Authorized User
Join Date: Apr 2006
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to akshay144
Default Gridview Update not firing in Update Panel

Hi All
I am creating a Datagrid on the fly, which works fine, added a edit,cancel update command field as a template field.
However wen I click on Update nothin happens, currently it isn't connected to the database I just want it to change the text of a button so I know the update works. All was workin fine b4 I added the UpdatePanel and Content Template. The ScriptManager is in the Master Page
Please help me....Thank u....
Please see below:-
HTML Code:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"> 

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
    <asp:GridView ID="GridView1"  runat="server" CellPadding="4" ForeColor="#333333" 
        GridLines="None" onrowupdating="GridView1_RowUpdating" 
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <asp:TemplateField ShowHeader="False">
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                        CommandName="Update" Text="Update"></asp:LinkButton>
                     <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                        CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                        CommandName="Edit" onclick="LinkButton1_Click1" Text="Edit"></asp:LinkButton>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#999999" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />

 protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) {                GridViewRow gvrow = GridView1.Rows[e.RowIndex];            TextBox txt_eventId = (TextBox)gvrow.Cells[1].Controls[0];            CheckBox chk_SelectCheckbox = (CheckBox)gvrow.Cells[4].Controls[0]; //checkbox to capture chkbox selection            Button1.Text = "DDDDDDDDDDDDDDDD"; }
Old August 13th, 2009, 10:20 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

I believe that the UpdatePanel can't handle templated controls.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update panel problem abhishekkashyap27 ASP.NET 2.0 Professional 1 August 14th, 2009 10:43 AM
Dropdown in update panel deb1980 ASP.NET 2.0 Professional 0 June 16th, 2009 06:42 AM
Update panel in .net 2.0 DIlip Kumar Sittu .NET Framework 2.0 1 July 18th, 2008 06:44 AM
Javascript Update Panel. blink18jew ASP.NET 1.0 and 1.1 Basics 0 June 30th, 2007 06:46 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.