473,324 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Like Airlines website - Redirect to results page after getting res

Hi everyone,
I have a ASP page that triggers a db-side stored procedure. At the end of
the procedure, it spits out a log file, that this ASP page reads and displays
for the users.

But the problem is that the database-stored Proc could take anything between
10 secs - to - 10 mins. I dont want the page to time out [But I dont want to
increase the time out in the IIS webserver]. Is there a way, like the
airlines websites do, where I can just show an animated gif while the
procedure runs and redirect the page to results at the end of the procedure
run.

ex: like orbitz or hotwire.... or anything like that, but not as complicated
as them.

Hope I made my question clear,

any ideas are truely appreciated,
_Mac
May 15 '06 #1
6 1928
Uday wrote:
Hi everyone,
I have a ASP page that triggers a db-side stored procedure. At the
end of the procedure, it spits out a log file, that this ASP page
reads and displays for the users.

But the problem is that the database-stored Proc could take anything
between 10 secs - to - 10 mins. I dont want the page to time out [But
I dont want to increase the time out in the IIS webserver]. Is there
a way, like the airlines websites do, where I can just show an
animated gif while the procedure runs and redirect the page to
results at the end of the procedure run.
?? What happens if the user closes the browser?
ex: like orbitz or hotwire.... or anything like that, but not as
complicated as them.

Not without some client-side code (see a javascript/jscript newsgroup). You
could use an xmlhttp object (AJAX) to periodically (using setTimeout) submit
to a server-side page that checks to see if the process is complete.
However, this could be very insecure: since it's all in client-side script,
it's visible to anyone who is knowledgeable enough to View Source or
retrieve the script from the browser cache (not at all hard to do). You
really need to know what you are doing to ensure that a user's session
cannot be hijacked.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 15 '06 #2

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:eI**************@TK2MSFTNGP02.phx.gbl...
Uday wrote:
Hi everyone,
I have a ASP page that triggers a db-side stored procedure. At the
end of the procedure, it spits out a log file, that this ASP page
reads and displays for the users.

But the problem is that the database-stored Proc could take anything
between 10 secs - to - 10 mins. I dont want the page to time out [But
I dont want to increase the time out in the IIS webserver]. Is there
a way, like the airlines websites do, where I can just show an
animated gif while the procedure runs and redirect the page to
results at the end of the procedure run.
?? What happens if the user closes the browser?

ex: like orbitz or hotwire.... or anything like that, but not as
complicated as them.

Not without some client-side code (see a javascript/jscript newsgroup).

You could use an xmlhttp object (AJAX) to periodically (using setTimeout) submit to a server-side page that checks to see if the process is complete.
However, this could be very insecure: since it's all in client-side script, it's visible to anyone who is knowledgeable enough to View Source or
retrieve the script from the browser cache (not at all hard to do). You
really need to know what you are doing to ensure that a user's session
cannot be hijacked.
How does using this approach expose the session to a greater risk of
hijacking?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

May 16 '06 #3
Anthony Jones wrote:
Not without some client-side code (see a javascript/jscript
newsgroup). You could use an xmlhttp object (AJAX) to periodically
(using setTimeout) submit to a server-side page that checks to see
if the process is complete. However, this could be very insecure:
since it's all in client-side script, it's visible to anyone who is
knowledgeable enough to View Source or retrieve the script from the
browser cache (not at all hard to do). You really need to know what
you are doing to ensure that a user's session cannot be hijacked.


How does using this approach expose the session to a greater risk of
hijacking?

The ID used to identify the asynchronous process may need to be part of the
xmlhttp submission, and, if the session ID is not being used, then that ID
will appear in plain text in the page's source. If the ID is something like
a user's email address or name, then it's guessable, right?
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 16 '06 #4

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:%2***************@TK2MSFTNGP02.phx.gbl...
Anthony Jones wrote:
Not without some client-side code (see a javascript/jscript
newsgroup). You could use an xmlhttp object (AJAX) to periodically
(using setTimeout) submit to a server-side page that checks to see
if the process is complete. However, this could be very insecure:
since it's all in client-side script, it's visible to anyone who is
knowledgeable enough to View Source or retrieve the script from the
browser cache (not at all hard to do). You really need to know what
you are doing to ensure that a user's session cannot be hijacked.
How does using this approach expose the session to a greater risk of
hijacking?

The ID used to identify the asynchronous process may need to be part of

the xmlhttp submission, and, if the session ID is not being used, then that ID
will appear in plain text in the page's source. If the ID is something like a user's email address or name, then it's guessable, right?
I see what you mean.

With or without using the Session ID it's still a good idea to allocate a
unique ID to the process. A GUID would be a good choice coupled with a
comparison of REMOTE_ADDR to which the GUID was originally issued.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

May 16 '06 #5
Uday wrote:
Hi everyone,
I have a ASP page that triggers a db-side stored procedure. At the end of
the procedure, it spits out a log file, that this ASP page reads and displays
for the users.
But the problem is that the database-stored Proc could take anything between
10 secs - to - 10 mins. I dont want the page to time out [But I dont want to
increase the time out in the IIS webserver]. Is there a way, like the
airlines websites do, where I can just show an animated gif while the
procedure runs and redirect the page to results at the end of the procedure
run.
ex: like orbitz or hotwire.... or anything like that, but not as complicated
as them.
Hope I made my question clear,
any ideas are truely appreciated,
_Mac


Rather than tie up the user's browser, you could do the following:

allocate a unique identifier (GUID, random number) embedded in a URL:
e.g. http://www.mysite.com/scheduledjobs?jobid=123456
and return that URL to the user with a message such as
"Request submitted: it will take some time to complete. Please click
<a href="http://www.mysite.com/scheduledjobs?jobid=123456">here</a>
to check for completion.
Or you could redirect to that URL immediately (see next item).

Create an ASP page, e.g.,
http://www.mysite.com/scheduledjobs
which, when passed a jobid value, checks to see whether the job (stored
procedure execution) with that jobid has completed. If so, the ASP page
redirects to a URL created by the stored procedure, (e.g.,
http://www.mysite.com/jobs/123456.log ). If, on the other hand, the
stored procedure hasn't finished, inform the user of that.

This allows the user to bookmark a report URL. They can periodically
return to see if the report has finished or e-mail the URL to someone.

So to reiterate:
1. The user executes a request to the URL, say,
http://www.mysite.com/jobrequest.asp?custid=55555
and is immediately returned a page, say
http://www.mysite.com/scheduledjobs.asp?jobid=123456
that shows a "report URL" where the finished report will later appear,

2. jobrequest.asp validates input data and stores request information
(jobid and all inputs) in a database table e.g., JOBTABLE.

3. A background job executes periodically or as requested, reading the
database table JOBTABLE and looking for new entries. When a new entry is
found, the stored procedure is executed and the output of the stored
procedure stored to a new report URL http://www.mysite.com/jobs/123456.log
Finally JOBTABLE is updated to indicate that the job completed and the
name of the report URL is entered into that table.

See http://aspfaq.com/show.asp?id=2143 for details on how to
trigger/schedule a background job.

4. scheduledjobs.asp, when passed a jobid, checks JOBTABLE and/or the
report URL to see if the jobid is valid and whether the job has
completed. If the job has completed, scheduledjobs.asp redirects to the
report URL for that jobid. Otherwise it informs the user that the jobid
does not exist or that the job has not completed. [Alternately
scheduledjobs.asp could have various utility functions as listing all
outstanding/completed jobs for that user or all users.]

5. Possibly write a periodic stored procedure to remove/archive old
report URLs and delete old entries from JOBTABLE.
May 17 '06 #6
Thanks Michael. Your suggestion sounds close to what I was looking for. I'll
try it. Thanks for your suggestions to Bob... I didn't get my hands dirty yet
with AJAX, so it sounds pretty complicated. But when I have more time, I'll
try your idea too.

thanks again,
_Uday
"Michael D. Kersey" wrote:
Uday wrote:
Hi everyone,
I have a ASP page that triggers a db-side stored procedure. At the end of
the procedure, it spits out a log file, that this ASP page reads and displays
for the users.
But the problem is that the database-stored Proc could take anything between
10 secs - to - 10 mins. I dont want the page to time out [But I dont want to
increase the time out in the IIS webserver]. Is there a way, like the
airlines websites do, where I can just show an animated gif while the
procedure runs and redirect the page to results at the end of the procedure
run.
ex: like orbitz or hotwire.... or anything like that, but not as complicated
as them.
Hope I made my question clear,
any ideas are truely appreciated,
_Mac


Rather than tie up the user's browser, you could do the following:

allocate a unique identifier (GUID, random number) embedded in a URL:
e.g. http://www.mysite.com/scheduledjobs?jobid=123456
and return that URL to the user with a message such as
"Request submitted: it will take some time to complete. Please click
<a href="http://www.mysite.com/scheduledjobs?jobid=123456">here</a>
to check for completion.
Or you could redirect to that URL immediately (see next item).

Create an ASP page, e.g.,
http://www.mysite.com/scheduledjobs
which, when passed a jobid value, checks to see whether the job (stored
procedure execution) with that jobid has completed. If so, the ASP page
redirects to a URL created by the stored procedure, (e.g.,
http://www.mysite.com/jobs/123456.log ). If, on the other hand, the
stored procedure hasn't finished, inform the user of that.

This allows the user to bookmark a report URL. They can periodically
return to see if the report has finished or e-mail the URL to someone.

So to reiterate:
1. The user executes a request to the URL, say,
http://www.mysite.com/jobrequest.asp?custid=55555
and is immediately returned a page, say
http://www.mysite.com/scheduledjobs.asp?jobid=123456
that shows a "report URL" where the finished report will later appear,

2. jobrequest.asp validates input data and stores request information
(jobid and all inputs) in a database table e.g., JOBTABLE.

3. A background job executes periodically or as requested, reading the
database table JOBTABLE and looking for new entries. When a new entry is
found, the stored procedure is executed and the output of the stored
procedure stored to a new report URL http://www.mysite.com/jobs/123456.log
Finally JOBTABLE is updated to indicate that the job completed and the
name of the report URL is entered into that table.

See http://aspfaq.com/show.asp?id=2143 for details on how to
trigger/schedule a background job.

4. scheduledjobs.asp, when passed a jobid, checks JOBTABLE and/or the
report URL to see if the jobid is valid and whether the job has
completed. If the job has completed, scheduledjobs.asp redirects to the
report URL for that jobid. Otherwise it informs the user that the jobid
does not exist or that the job has not completed. [Alternately
scheduledjobs.asp could have various utility functions as listing all
outstanding/completed jobs for that user or all users.]

5. Possibly write a periodic stored procedure to remove/archive old
report URLs and delete old entries from JOBTABLE.

May 17 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: michael_vanommeren | last post by:
I have two web applications that I am working with and I am trying to do a Response.Redirect from one to the other. They are setup as separate web applications on the same IIS server. If I go...
6
by: CK | last post by:
I have a web page called PageOne.aspx which is supposed to do a long process but I don't need to show any results to the client, so I want to redirect the client to PageTwo.aspx right in the...
3
by: ESmith | last post by:
I've written a website that works fine when the user types in the URL into a browser window. Now, one of our clients, whose website has a left panel "iframe" menu, put our site in as a link and my...
13
by: Peter Chant | last post by:
I'm considering setting a website up for a club. I do not plan the contents to be for public consumption, but on the other hand I'm not going to have anything on there that is confidential, that...
1
by: wardy1975 | last post by:
Hi all, got a bit of a strange one....I am developing in ASP.NET 2.0 and I have some code in my Session_Start method that sets user attributes. If an error occurs at this time, such as the user is...
4
by: moni | last post by:
Hi, I was hoping I could get a help on this one. I am creating a simple website, in which I have a login after which the user gets logged in using a session variable where I append the ID,eg ...
7
by: Atul | last post by:
Hi Theres a website that books hotels . user enters the information and according to that results are displayed to the user.Let it be website A. Now I want to create a new project with...
7
bugboy
by: bugboy | last post by:
Hi, I'm just learning PHP. I want to redirect the user, after hitting submit, either to the same page displaying the results (as it is now) or if no results are found then send them to a new page...
1
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.