Solved

redirect after multiple formview.updateitem(true)

Posted on 2007-03-26
3
559 Views
Last Modified: 2011-10-03
Say that I do something like this in a button click.
protected void BtnCloseSave_Click(object sender, EventArgs e)
    {
        FormView4.UpdateItem(true);
        FormView5.UpdateItem(true);
        FormView6.UpdateItem(true);
        FormView7.UpdateItem(true);
        FormView8.UpdateItem(true);
        FormView9.UpdateItem(true);
       
    }

How can I--after the last formview update--redirect the user to a different page if all the updates occured?
Do I just check the ispagevalid or something or is there a more sure way to know each updated occured?
0
Comment
Question by:sonicysa
  • 2
3 Comments
 
LVL 5

Expert Comment

by:asp_lha
Comment Utility

Is this you want to do (I write it use VB.NET ) ?

    Try
   
        FormView4.UpdateItem(true)
        FormView5.UpdateItem(true)
        FormView6.UpdateItem(true)
        FormView7.UpdateItem(true)
        FormView8.UpdateItem(true)
        FormView9.UpdateItem(true)

        ' Do  your redirect
        Response.redirect("myPage.aspx")
    Catch ex As HttpException
   
      MessageLabel.Text = "Some thing is wrong!"
   
    End Try

0
 
LVL 2

Author Comment

by:sonicysa
Comment Utility
Are you saying there is nothing else I should be doing?
In other words if any of the formview updates fails for any reason it will never redirect correct?
0
 
LVL 5

Accepted Solution

by:
asp_lha earned 500 total points
Comment Utility
if you want to redirect when  any update fails , you can do some change:

    Try
        FormView4.UpdateItem(true)
        FormView5.UpdateItem(true)
        FormView6.UpdateItem(true)
        FormView7.UpdateItem(true)
        FormView8.UpdateItem(true)
        FormView9.UpdateItem(true)

        ' Do  your redirect
        Response.redirect("UpdateOK.aspx")
    Catch ex As HttpException    
        Response.redirect("UpdateFail.aspx")    
    End Try

(sorry for my poor English , maybe I couldn't understand you very well)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

11 Experts available now in Live!

Get 1:1 Help Now