We help IT Professionals succeed at work.

Update event not firing with sql datasource

MrAgile
MrAgile asked
on
967 Views
Last Modified: 2013-11-07
HI There,

Can someone tell me why the update event in my gridview is not working? Do I need to add something into my code?

Sean - thanks in advance
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:GridView ID="grdStoresCategories" DataKeyNames="jobID" DataSourceID="srcJobAds"
                                AutoGenerateColumns="true" AutoGenerateDeleteButton="true" AutoGenerateEditButton="true"
                                SelectedRowStyle-CssClass="selectedRow" CssClass="gridView" runat="server" jobTitle="true"
                                Width="40%">
                            </asp:GridView>
                            <asp:SqlDataSource ID="srcJobAds" ConnectionString="<%$ ConnectionStrings:toysruscomaudb %>"
                                SelectCommand="SELECT [jobID] ,[jobTitle], [jobLocation], [jobDescription] FROM [toys].[tblJobAds] Order By [datePosted]"
                                DeleteCommand="Delete FROM [toys].[tblJobAds] where [jobID] = @jobID" UpdateCommand="UPDATE [toys].[tblJobAds] SET jobTitle=@jobTitle, jobLocation=@jobLocation, jobDescription=@jobDescription where jobID = @jobID"
                                runat="server">
                                <UpdateParameters>
                                    <asp:Parameter Name="jobID" Type="Int32" />
                                    <asp:Parameter Name="jobTitle" Type="String" Size="250" />
                                    <asp:Parameter Name="jobLocation" Type="String" Size="50" />
                                    <asp:Parameter Name="jobDescription" Type="String" Size="1000" />
                                </UpdateParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="jobID" />
                                </DeleteParameters>
                            </asp:SqlDataSource>
                        </ContentTemplate>
                    </asp:UpdatePanel>

Open in new window

Comment
Watch Question

You tried setting the triggers property in your update panel to always?
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.