Waiting for code to finish

I need a way to wait for the current code i have pending in my aspx page to finish before redirecting to my success url. Basically I have a submit button that processes all the info and loads it into sql. After this i have a java call to print the form and then a redirect call to send the user to the success page. I have tried threading.sleep with out resolve.
LVL 1
negenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
If you are talking about .NET 2.0 (2005), then you could do asynchronous data writes:

ADO.NET 2.0: The Data Access Classes Nobody Learned About
http://www.devx.com/SummitDays/Article/30806

Bob
negenAuthor Commented:
.net 2.0 yes, ado- no
Bob LearnedCommented:
>>loads it into sql
If you are loading it into SQL without ADO.NET, then how are you doing it?

Bob
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

negenAuthor Commented:
Ok, I am not asking for any DB help.  I need to know any other way: besides thread.sleep to allow a program to finishe executing the items it has on the stack before going to the next line: for example....

Submit.Visible = False
        Button2.Visible = False
        Button1.Visible = False
        Sign_Panel.Visible = True
        Response.ContentType = "application/msword"
        Response.AddHeader("Content-Disposition", "attachment;filename=My__File.doc")

I need a pause here to wait for the file to save.

Response.Redirect("")

Sorry for any confusion
Bob LearnedCommented:
I have no idea.

Bob
negenAuthor Commented:
Problem self resolved by using javascript:settimeout function, please close

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.