Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

redirect after multiple formview.updateitem(true)

Posted on 2007-03-26
3
Medium Priority
?
572 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
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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
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.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Loops Section Overview

927 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