Solved

5 details views hiden in accordion panes need to have one submit button

Posted on 2009-04-14
4
486 Views
Last Modified: 2013-12-17
Hello guys, I have a page that has a number of details views (insert page only) all broken up and placed in the accordion panes for data presentation and to catagorise the data entry. my question is how can I insert and edit with link buttons outside of the accordion to submit data in all the details views???

 What I need to acheive here is after the user clicks submit, and validation runs is to insert or update 5 details views simultainiously .
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server">

            <ajaxToolkit:TabPanel ID="TabPanel1" runat="server">

                <HeaderTemplate>

                    Customer Info

                </HeaderTemplate>

                <ContentTemplate>

                    <ajaxToolkit:Accordion ID="Accordion1" runat="server" SelectedIndex="0" HeaderCssClass="accordionHeaderDeselected"

                        HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent"

                        FadeTransitions="false" FramesPerSecond="40" TransitionDuration="250" AutoSize="None"

                        RequireOpenedPane="false" SuppressHeaderPostbacks="true">

                        <Panes>

                            <ajaxToolkit:AccordionPane ID="AccordionPane12" runat="server">

                                <Header>

                                    <a href="" style="text-decoration: none">Customers Details</a></Header>

                                <Content>

                                    <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" AutoGenerateRows="False"

                                        DataKeyNames="CustomerID" DataSourceID="CustomerDS" DefaultMode="Insert">

                                        <Fields>

                                            <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" InsertVisible="False"

                                                ReadOnly="True" SortExpression="CustomerID" />

                                            <asp:TemplateField HeaderText="CMAID" SortExpression="CMAID">

                                                <HeaderTemplate>

                                                    Name_Contact

                                                </HeaderTemplate>

                                                <InsertItemTemplate>

                                                    &nbsp;<asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="CMANameLUTDS"

                                                        DataTextField="CMAName" DataValueField="CMAID" SelectedValue='<%# Bind("CMAID") %>'>

                                                    </asp:DropDownList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("CMAID") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:BoundField DataField="Name_Contact" HeaderText="Name_Contact" SortExpression="Name_Contact" />

                                            <asp:BoundField DataField="Name_First" HeaderText="Name_First" SortExpression="Name_First" />

                                            <asp:BoundField DataField="Name_Last" HeaderText="Name_Last" SortExpression="Name_Last" />

                                            <asp:BoundField DataField="CARMSID" HeaderText="File Number" SortExpression="CARMSID" />

                                            <asp:TemplateField HeaderText="GroupParticipant" SortExpression="GroupParticipant">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("GroupParticipant") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:RadioButtonList ID="RadioButtonList2" runat="server" SelectedValue='<%# Bind("GroupParticipant") %>'>

                                                        <asp:ListItem Selected="True" Value="0">No</asp:ListItem>

                                                        <asp:ListItem Value="1">Yes</asp:ListItem>

                                                    </asp:RadioButtonList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("GroupParticipant") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="CustomerTypeGroupID" SortExpression="CustomerTypeGroupID">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("CustomerTypeGroupID") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:DropDownList ID="DropDownList5" runat="server" DataSourceID="GroupTypeLUTDS"

                                                        DataTextField="CustomerTypeGroup" DataValueField="CustomerTypeGroupID" SelectedValue='<%# Bind("CustomerTypeGroupID") %>'>

                                                    </asp:DropDownList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("CustomerTypeGroupID") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="CustomerGroupNameID" SortExpression="CustomerGroupNameID">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("CustomerGroupNameID") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:DropDownList ID="DropDownList6" runat="server">

                                                    </asp:DropDownList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label8" runat="server" Text='<%# Bind("CustomerGroupNameID") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Notes" SortExpression="Notes">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("Notes") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("Notes") %>' Height="197px"

                                                        TextMode="MultiLine" Width="412px"></asp:TextBox>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label9" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="DataEntryOfficer_UserID" SortExpression="DataEntryOfficer_UserID">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("DataEntryOfficer_UserID") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:DropDownList ID="DropDownList7" runat="server" DataSourceID="StaffLUTDS" DataTextField="FullName"

                                                        DataValueField="UserID" SelectedValue='<%# Bind("DataEntryOfficer_UserID") %>'>

                                                    </asp:DropDownList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label10" runat="server" Text='<%# Bind("DataEntryOfficer_UserID") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="CustomerDetails_EditedBy" SortExpression="CustomerDetails_EditedBy">

                                                <InsertItemTemplate>

                                                    <asp:DropDownList ID="DropDownList8" runat="server" DataSourceID="StaffLUTDS" DataTextField="UserName"

                                                        DataValueField="UserName" SelectedValue='<%# Bind("CustomerDetails_EditedBy") %>'>

                                                    </asp:DropDownList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label11" runat="server" Text='<%# Bind("CustomerDetails_EditedBy") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="CustomerDetails_EditedDate" SortExpression="CustomerDetails_EditedDate">

                                                <InsertItemTemplate>

                                                    <asp:TextBox ID="TextBox21" runat="server" Text='<%# Bind("CustomerDetails_EditedDate") %>'></asp:TextBox>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label12" runat="server" Text='<%# Bind("CustomerDetails_EditedDate") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:CommandField ShowInsertButton="True" />

                                        </Fields>

                                    </asp:DetailsView>

                                </Content>

                            </ajaxToolkit:AccordionPane>

                            <ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server">

                                <Header>

                                    <a href="" style="text-decoration: none">ATO Details</a></Header>

                                <Content>

                                    <asp:DetailsView ID="DetailsView2" runat="server" Height="50px" Width="125px" AutoGenerateRows="False"

                                        DataKeyNames="CustomerID" DataSourceID="CustomerDS" DefaultMode="Insert">

                                        <Fields>

                                            <asp:BoundField DataField="Name_Entity" HeaderText="Name_Entity" SortExpression="Name_Entity" />

                                            <asp:BoundField DataField="ABN" HeaderText="ABN" SortExpression="ABN" />

                                            <asp:BoundField DataField="ACN" HeaderText="ACN" SortExpression="ACN" />

                                            <asp:BoundField DataField="Name_LegalTrading" HeaderText="Name_LegalTrading" SortExpression="Name_LegalTrading" />

                                            <asp:BoundField DataField="TradingNameCount" HeaderText="TradingNameCount" SortExpression="TradingNameCount" />

                                            <asp:TemplateField HeaderText="EntityTypeID" SortExpression="EntityTypeID">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("EntityTypeID") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("EntityTypeID") %>'></asp:TextBox>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("EntityTypeID") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="GST_Reg" SortExpression="GST_Reg">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("GST_Reg") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("GST_Reg") %>'></asp:TextBox>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("GST_Reg") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="ABN_Valid" SortExpression="ABN_Valid">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ABN_Valid") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ABN_Valid") %>'></asp:TextBox>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("ABN_Valid") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="ABNStatusDate" SortExpression="ABNStatusDate">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("ABNStatusDate") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("ABNStatusDate") %>'></asp:TextBox>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("ABNStatusDate") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="GSTStatusDate" SortExpression="GSTStatusDate">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("GSTStatusDate") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("GSTStatusDate") %>'></asp:TextBox>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("GSTStatusDate") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="LastModifiedDate" SortExpression="LastModifiedDate">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("LastModifiedDate") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("LastModifiedDate") %>'></asp:TextBox>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("LastModifiedDate") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:BoundField DataField="SAPVendor" HeaderText="SAPVendor" SortExpression="SAPVendor" />

                                            <asp:CommandField ShowInsertButton="True" />

                                        </Fields>

                                    </asp:DetailsView>

                                </Content>

                            </ajaxToolkit:AccordionPane>

                            <ajaxToolkit:AccordionPane ID="AccordionPane2" runat="server">

                                <Header>

                                    <a href="" style="text-decoration: none">Primary Contact</a></Header>

                                <Content>

                                    <asp:DetailsView ID="DetailsView3" runat="server" Height="50px" Width="125px" AutoGenerateRows="False"

                                        DataKeyNames="CustomerID" DataSourceID="CustomerDS" DefaultMode="Insert">

                                        <Fields>

                                            <asp:TemplateField HeaderText="PreferredContactMethod" SortExpression="PreferredContactMethod">

                                                <InsertItemTemplate>

                                                    <asp:RadioButtonList ID="RadioButtonList1" runat="server" SelectedValue='<%# Bind("PreferredContactMethod") %>'>

                                                        <asp:ListItem Selected="True" Value="1">Business Phone</asp:ListItem>

                                                        <asp:ListItem Value="2">Home Phone</asp:ListItem>

                                                        <asp:ListItem Value="3">Mobile Phone</asp:ListItem>

                                                        <asp:ListItem Value="4">E-Mail</asp:ListItem>

                                                        <asp:ListItem Value="5">Fax</asp:ListItem>

                                                    </asp:RadioButtonList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("PreferredContactMethod") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:BoundField DataField="Phone_Business" HeaderText="Phone_Business" SortExpression="Phone_Business" />

                                            <asp:BoundField DataField="Mobile_Business" HeaderText="Mobile_Business" SortExpression="Mobile_Business" />

                                            <asp:BoundField DataField="Fax_Business" HeaderText="Fax_Business" SortExpression="Fax_Business" />

                                            <asp:BoundField DataField="Email_Business" HeaderText="Email_Business" SortExpression="Email_Business" />

                                            <asp:BoundField DataField="Phone_Private" HeaderText="Phone_Private" SortExpression="Phone_Private" />

                                            <asp:CommandField ShowInsertButton="True" />

                                        </Fields>

                                    </asp:DetailsView>

                                </Content>

                            </ajaxToolkit:AccordionPane>

                            <ajaxToolkit:AccordionPane ID="AccordionPane3" runat="server">

                                <Header>

                                    <a href="" style="text-decoration: none">Mailing</a></Header>

                                <Content>

                                    <asp:DetailsView ID="DetailsView5" runat="server" AutoGenerateRows="False" DataKeyNames="CustomerID"

                                        DataSourceID="CustomerDS" Height="50px" Width="125px" DefaultMode="Insert">

                                        <Fields>

                                            <asp:BoundField DataField="Postal_Address" HeaderText="Postal_Address" SortExpression="Postal_Address" />

                                            <asp:BoundField DataField="Postal_Address_Line2" HeaderText="Postal_Address_Line2"

                                                SortExpression="Postal_Address_Line2" />

                                            <asp:TemplateField HeaderText="StateID" SortExpression="StateID">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("StateID") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="StateLUTDS" DataTextField="State"

                                                        DataValueField="StateID" SelectedValue='<%# Bind("StateID") %>'>

                                                    </asp:DropDownList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("StateID") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="LocationID" SortExpression="LocationID">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("LocationID") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="LocationLUTDS"

                                                        DataTextField="Locality" DataValueField="LocationID" SelectedValue='<%# Bind("LocationID") %>'>

                                                    </asp:DropDownList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("LocationID") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="PostCodeID" SortExpression="PostCodeID">

                                                <EditItemTemplate>

                                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("PostCodeID") %>'></asp:TextBox>

                                                </EditItemTemplate>

                                                <InsertItemTemplate>

                                                    <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="PostcodeLUTDS"

                                                        DataTextField="PostcodeID" DataValueField="UID" SelectedValue='<%# Bind("PostCodeID") %>'>

                                                    </asp:DropDownList>

                                                </InsertItemTemplate>

                                                <ItemTemplate>

                                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("PostCodeID") %>'></asp:Label>

                                                </ItemTemplate>

                                            </asp:TemplateField>

                                            <asp:BoundField DataField="POBox" HeaderText="POBox" SortExpression="POBox" />

                                            <asp:CommandField ShowInsertButton="True" />

                                        </Fields>

                                    </asp:DetailsView>

                                </Content>

                            </ajaxToolkit:AccordionPane>

                        </Panes>

                    </ajaxToolkit:Accordion>

                </ContentTemplate>

            </ajaxToolkit:TabPanel>

        </ajaxToolkit:TabContainer>

        <asp:LinkButton ID="LinkButton2" runat="server" Text="Submit" CommandName="submit"></asp:LinkButton>

        <asp:LinkButton ID="Button2" runat="server" Text="Submit & Close" CommandName="submit"

            OnClientClick="CloseWnd();return false;" />

        <asp:LinkButton ID="LinkButton1" runat="server" Text="Close" OnClientClick="CloseWnd();return false;" />

Open in new window

0
Comment
Question by:Trentos
4 Comments
 
LVL 14

Accepted Solution

by:
amar31282 earned 500 total points
ID: 24211454
Hi Trent,
Please use this code in Click event of update/submit LinkButton
 protected void LinkButton2_Click(object sender, EventArgs e)

    {

        DetailsView1.UpdateItem(true);

        DetailsView2.UpdateItem(true);

        DetailsView3.UpdateItem(true);

        DetailsView5.UpdateItem(true);

    }

Open in new window

0
 

Author Closing Comment

by:Trentos
ID: 31570287
Great
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now