|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

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
|
|
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"; }
|

August 13th, 2009, 11:20 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 2,922
Thanks: 0
Thanked 13 Times in 12 Posts
|
|
I believe that the UpdatePanel can't handle templated controls.
__________________
--
Joe
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |