Using C# to redirect one form to another after a specific task completes

Discussion in 'ASP .Net' started by Brian Gordaychik, Dec 2, 2004.

  1. Hey all,
    I have a web application which loads a wizard (another smaller form to
    get user info). As soon as the wizard completes, I need to have the
    original page from which the wizard was called from redirect to a new
    page based on the users input.

    I've tried using a seperate thread and a lock to wait until the wizard
    finishes, but I cannot do a Response.Redirect() from the second
    thread.

    Does anyone have any ideas? Thanks,
    Brian Gordaychik
    (bpg24 -at- drexel -dot- edu)
    Brian Gordaychik, Dec 2, 2004
    #1
    1. Advertising

  2. Brian Gordaychik

    WJ Guest

    The reliable method (works for me so far) is to keep passing the original
    Url (the 1st caller) to each step. The last step would then have it and
    redirect to the orginal caller (the 1st caller if I understand it
    correctly). Example: You start out with http://mySite.com.Default.Aspx. This
    will call Page1Wizard.Aspx with its Url, Page1 then passes to Page2Wizard
    and so on.... The last page will do something like this:

    1. On its onPageLoad event, you do string
    OriginalUrl=Request["FirstCaller"];\
    2. Response.Redirect(OriginalUrl);

    John

    "Brian Gordaychik" <> wrote in message
    news:...
    > Hey all,
    > I have a web application which loads a wizard (another smaller form to
    > get user info). As soon as the wizard completes, I need to have the
    > original page from which the wizard was called from redirect to a new
    > page based on the users input.
    >
    > I've tried using a seperate thread and a lock to wait until the wizard
    > finishes, but I cannot do a Response.Redirect() from the second
    > thread.
    >
    > Does anyone have any ideas? Thanks,
    > Brian Gordaychik
    > (bpg24 -at- drexel -dot- edu)
    WJ, Dec 2, 2004
    #2
    1. Advertising

  3. Brian Gordaychik

    bruce barker Guest

    you can use client script to do this. the subform can update it parents
    (window.opener) location.

    -- bruce (sqlwork.com)


    "Brian Gordaychik" <> wrote in message
    news:...
    | Hey all,
    | I have a web application which loads a wizard (another smaller form to
    | get user info). As soon as the wizard completes, I need to have the
    | original page from which the wizard was called from redirect to a new
    | page based on the users input.
    |
    | I've tried using a seperate thread and a lock to wait until the wizard
    | finishes, but I cannot do a Response.Redirect() from the second
    | thread.
    |
    | Does anyone have any ideas? Thanks,
    | Brian Gordaychik
    | (bpg24 -at- drexel -dot- edu)
    bruce barker, Dec 2, 2004
    #3
  4. No, that would be simple... maybe I'm not being clear. After the
    wizard completes, I want to have the page that called the wizard
    redirect to some page. But I only want that to happen once they click
    the finish button on the wizard page. I don't want to simply redirect
    the window that contains the wizard. Any ideas? Thanks,
    Brian
    Brian Gordaychik, Dec 3, 2004
    #4
  5. "Brian Gordaychik" <> wrote in message
    news:...
    > No, that would be simple... maybe I'm not being clear. After the
    > wizard completes, I want to have the page that called the wizard
    > redirect to some page. But I only want that to happen once they click
    > the finish button on the wizard page. I don't want to simply redirect
    > the window that contains the wizard. Any ideas? Thanks,


    Is the original page still being shown in another window? If so, then you'd
    need to use JavaScript to have the first window detect when the Wizard
    window closes. The first window would then use JavaScript to do the
    redirect.

    John Saunders
    John Saunders, Dec 3, 2004
    #5
  6. Brian Gordaychik

    gordy Guest

    Thats the question, how do I do that with javascript then? Has anyone
    done this before and could possibly show me some code? I was thinking
    of using 2 different threads in c#, that way I could pend until the
    wizard is complete, but that method won't work.
    -Brian


    John Saunders wrote:
    > "Brian Gordaychik" <> wrote in message
    > news:...
    > > No, that would be simple... maybe I'm not being clear. After the
    > > wizard completes, I want to have the page that called the wizard
    > > redirect to some page. But I only want that to happen once they

    click
    > > the finish button on the wizard page. I don't want to simply

    redirect
    > > the window that contains the wizard. Any ideas? Thanks,

    >
    > Is the original page still being shown in another window? If so, then

    you'd
    > need to use JavaScript to have the first window detect when the

    Wizard
    > window closes. The first window would then use JavaScript to do the
    > redirect.
    >
    > John Saunders
    gordy, Dec 6, 2004
    #6
  7. "gordy" <> wrote in message
    news:...
    > Thats the question, how do I do that with javascript then? Has anyone
    > done this before and could possibly show me some code? I was thinking
    > of using 2 different threads in c#, that way I could pend until the
    > wizard is complete, but that method won't work.


    Brian, I'm not a JavaScript expert and don't have any code for this. But I
    should remind you - this is all client-side stuff. It has nothing to do with
    extra threads or C#.

    You should consider getting this to work with two .html pages - one to play
    the calling page and one to play the wizard. Figure out how to make the
    calling page wait until the wizard is done, then redirect somewhere. Once
    you get that done, you just have to get the same JavaScript on you .aspx
    pages.

    John Saunders



    > John Saunders wrote:
    >> "Brian Gordaychik" <> wrote in message
    >> news:...
    >> > No, that would be simple... maybe I'm not being clear. After the
    >> > wizard completes, I want to have the page that called the wizard
    >> > redirect to some page. But I only want that to happen once they

    > click
    >> > the finish button on the wizard page. I don't want to simply

    > redirect
    >> > the window that contains the wizard. Any ideas? Thanks,

    >>
    >> Is the original page still being shown in another window? If so, then

    > you'd
    >> need to use JavaScript to have the first window detect when the

    > Wizard
    >> window closes. The first window would then use JavaScript to do the
    >> redirect.
    >>
    >> John Saunders

    >
    John Saunders, Dec 6, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. krabhi
    Replies:
    1
    Views:
    9,271
    Marco Meschieri
    Aug 9, 2006
  2. rkk
    Replies:
    9
    Views:
    805
    CBFalconer
    Sep 24, 2006
  3. Basman
    Replies:
    0
    Views:
    417
    Basman
    Oct 29, 2007
  4. Mike
    Replies:
    1
    Views:
    1,922
    GArlington
    May 12, 2008
  5. Ingo Weiss
    Replies:
    0
    Views:
    121
    Ingo Weiss
    Mar 1, 2010
Loading...

Share This Page