Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 13th, 2009, 10:40 AM
Authorized User
 
Join Date: Apr 2006
Location: london, , United Kingdom.
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:-
Masterpage.aspx
HTML Code:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"> 
</asp:ScriptManager>
UpdateAttendance.aspx

Code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
    <ContentTemplate>
    <asp:GridView ID="GridView1"  runat="server" CellPadding="4" ForeColor="#333333" 
        GridLines="None" onrowupdating="GridView1_RowUpdating" 
        onrowediting="GridView1_RowEditing" 
        onrowdatabound="GridView1_RowDataBound" 
        onselectedindexchanged="GridView1_SelectedIndexChanged" 
        onrowcommand="GridView1_RowCommand" 
        onrowcancelingedit="GridView1_RowCancelingEdit" 
    oninit="GridView1_Init">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:TemplateField ShowHeader="False">
                <EditItemTemplate>
                    <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>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                        CommandName="Edit" onclick="LinkButton1_Click1" Text="Edit"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <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" />
        
    </asp:GridView>
    </ContentTemplate></asp:UpdatePanel>

RowUpdating
Code:
 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"; }
Reply With Quote
  #2 (permalink)  
Old August 13th, 2009, 11:20 AM
joefawcett's Avatar
Wrox Author
Points: 9,731, Level: 42
Points: 9,731, Level: 42 Points: 9,731, Level: 42 Points: 9,731, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,068
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I believe that the UpdatePanel can't handle templated controls.
__________________
Joe
http://joe.fawcett.name/
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 04:31 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.