?
Solved

Execute Update on multiple FormViews

Posted on 2009-05-14
7
Medium Priority
?
367 Views
Last Modified: 2013-12-17
Greetings all

I have a page with 4 formview controls on it. Each FormView has an EditTemplate with Update and Cancel buttons. Iwould liek to provide "Update All" and "Cancel All" buttons.

How do I get these buttons to execute the commands associated with the respective Update/Cancel buttons in each of the formviews?

In advance, thanks!!

     allanmark
0
Comment
Question by:allanmark
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 8

Accepted Solution

by:
ppittle earned 1400 total points
ID: 24386907
<asp:Button ID=UpdateAllButton" runat="server" Text="UpdateAll" OnClick="UpdateAllButton_Click" />
<%-- Code Behind --%>

protected void UpdateAllButton_Click (object sender, EventArgs e)
{
bool doValidation = true;
//Call the Update method on each FormView:
FormView1.UpdateItem(doValidation );
FormView2.UpdateItem(doValidation );
FormView3.UpdateItem(doValidation );
FormView4.UdpateItem(doValidation );
}
0
 

Author Comment

by:allanmark
ID: 24394791
Tks!

Applied your suggestion. What happens is that the data for the first formview is saved, but for those following it is not
<asp:LinkButton ID="lnkbtnUpdateAll_AE" runat="server" OnClick="ButtonUpdateAll_Click">Update all details</asp:LinkButton>
 
protected void ButtonUpdateAll_Click(object sender, EventArgs e)
    {
        bool doValidation = true;
     
        fvAddress.UpdateItem(doValidation);
 
        fvSpousal.UpdateItem(doValidation);
    }

Open in new window

0
 

Author Comment

by:allanmark
ID: 24394799
...sorry .. hit the wrong button ...


Is there anything else that I need to be doing?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:allanmark
ID: 24394981
.. not sure if this has any bearing on the issue ...

If the update commands are swopped around, so that the last formview (in order that they appear on the page) is updated first, and then the first formview is updated   --  this works?
0
 

Author Comment

by:allanmark
ID: 24431441
SORRY ... it was a stupid mistake on my part!!

Works 100%!
0
 

Author Closing Comment

by:allanmark
ID: 31581538
Many thanks!!
0
 
LVL 8

Expert Comment

by:ppittle
ID: 24431602
Glad to see everything worked out =)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 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