?
Solved

redirect after multiple formview.updateitem(true)

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

800 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