473,231 Members | 1,953 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,231 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 1925
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.