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

  • Thread starter Brian Gordaychik
  • Start date
B

Brian Gordaychik

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)
 
W

WJ

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
 
B

bruce barker

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

-- bruce (sqlwork.com)


| 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)
 
B

Brian Gordaychik

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
 
J

John Saunders

Brian Gordaychik said:
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
 
G

gordy

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
 
J

John Saunders

gordy said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top