Solved

redirect after multiple formview.updateitem(true)

Posted on 2007-03-26
3
568 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
[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
  • 2
3 Comments
 
LVL 5

Expert Comment

by:asp_lha
ID: 18797134

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
ID: 18797146
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
ID: 18797456
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

Industry Leaders: 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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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