Link to home
Start Free TrialLog in
Avatar of sonicysa
sonicysa

asked on

redirect after multiple formview.updateitem(true)

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?
Avatar of asp_lha
asp_lha


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

Avatar of sonicysa

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of asp_lha
asp_lha

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