Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

asked on

Problem with objectdatasource and listview

I am trying to do an update on my listview and it is bound to an ODS. I can't seem to get the textboxes. I have tried control parameters with the textbox names but it says it can't find them. what am I missing. The page is a content page within a masterpage.
<asp:ListView ID="lvSets" runat="server" DataSourceID="objSetName" OnItemUpdating="SetListView_ItemUpdating" DataKeyNames="SetID" ItemPlaceholderID="itemPlaceHolder1" OnItemDataBound="lvArticles_ItemDataBound">
            <ItemTemplate>
                <table>
                    <tr>
                        <td>
                            <h1>
                                Set Name:
                                <asp:Label ID="lblSetName" runat="server" Font-Bold="true" Text='<%# Eval("SetName") %>' /></h1><br />
                      
                            <table>
                                <tr>
                                    <td style="background-color: #BABD99;">
                                        
                                    </td>
                                    <td style="background-color: #BABD99;">
                                        Set Type:
                                    </td>
                                    <td style="background-color: #BABD99;">
                                        Set Index:
                                    </td>
                                    <td style="background-color: #BABD99;">
                                        Set Site:
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                          <asp:LinkButton ID="lnkDelete" Text="Delete Set" CommandName="Delete" runat="server"></asp:LinkButton>
                                          <asp:LinkButton ID="lnkEdit" Text="Edit Set" CommandName="Edit" runat="server"></asp:LinkButton>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblSetType" Text='<%# Eval("SetType") %>' runat="server"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblSetIndex" Text='<%# Eval("SetIndex") %>' runat="server"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblSetSite" Text='<%# Eval("SetSite") %>' runat="server"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <tr>
                            <td>
          
                            </td>
                        </tr>
                </table>
            </ItemTemplate>
            <EditItemTemplate>
             Item Update #: <asp:Label ID="lblEdRecID" runat="server" Text='<%# Eval("RecID") %>'></asp:Label>
               <table>
                                <tr>
                                    <td style="background-color: #BABD99;">
                                        Set Name
                                    </td>
                                    <td style="background-color: #BABD99;">
                                        Set Type:
                                    </td>
                                    <td style="background-color: #BABD99;">
                                        Set Index:
                                    </td>
                                    <td style="background-color: #BABD99;">
                                        Set Site:
                                    </td>
                                    <td style="background-color: #BABD99;">
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:TextBox ID="txteSetName" Text='<%# Eval("SetName") %>' runat="server"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txteSetType" Text='<%# Eval("SetType") %>' runat="server"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txteSetIndex" Text='<%# Eval("SetIndex") %>' runat="server"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txteSetSite" Text='<%# Eval("SetSite") %>' runat="server"></asp:TextBox>
                                    </td>
                                    <td>
                                         <asp:LinkButton ID="lnkUpdate" Text="Update" CommandName="Update" runat="server"></asp:LinkButton>
                                         <asp:LinkButton ID="lnkCancel" Text="Cancel" CommandName="Cancel" runat="server"></asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
            
            </EditItemTemplate>
            <LayoutTemplate>
               <asp:PlaceHolder ID="itemPlaceHolder1" runat="server" />
            </LayoutTemplate>
         </asp:ListView>
    <asp:ObjectDataSource ID="objSetName" runat="server" SelectMethod="GetList" UpdateMethod="UpdateSet" DeleteMethod="DeleteItem" TypeName="clsSetInfo1">
        <SelectParameters>
            <asp:QueryStringParameter QueryStringField="pid" Name="RecID" />
        </SelectParameters>
        <DeleteParameters>
        <asp:Parameter Name="SetID" />
        </DeleteParameters>
        <UpdateParameters>
        <asp:ControlParameter ControlID="txteSetName" Name="SetName" PropertyName="Text" />
        <asp:ControlParameter ControlID="txteSetType" Name="SetType" PropertyName="Text" />
        <asp:ControlParameter ControlID="txteSetIndex" Name="SetIndex" PropertyName="Text" />
        <asp:ControlParameter ControlID="txteSetSite" Name="SetSite" PropertyName="Text" />
        <asp:Parameter Name="SetID"  />
        </UpdateParameters>
    </asp:ObjectDataSource>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial