Page load never ends

B

Bob Murdoch

I have a relatively simple ASP page written in javascript, that basically
contains a table, a dropdown list populated by a query, and a button.

The problem is that when first navigating to this page, the progress bar in
IE only shows the page as being 10 or 20% complete, even though the page has
fully loaded.

I originally had a mix of html/jscript/html (in that order), and tried
changing that to html/jscript just to see if the conversion from static to
dynamic to static code was causing a problem, but with no effect.

I have run the output of this page thru two or three different html
validators, none of which show a problem with the final code.

I'm using IIS on W2k server, and IE6 or IE5.5 on client.

tia for any pointers,

Bob M..
 
B

Bob Murdoch

John Beschler said:
Let me be the first to say: Please post the relevant code.

<G>.

I was going to, but didn't want to waste anyone's bandwidth if this was a
common problem. Here it is:

<%@ language="JavaScript"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!--#include virtual="/BTRC/Shared/Security/AuthenticateUser.asp" -->
<!--#include virtual="/BTRC/Shared/Server/DbLibrary.asp" -->
<link REL="stylesheet" TYPE="text/css"
HREF="/BTRC/Shared/Style/Style.css">
<link REL="stylesheet" TYPE="text/css"
HREF="/BTRC/Shared/Style/BgStyles.css">
<link REL="stylesheet" TYPE="text/css" HREF="Style/Style.css">
</head>
<body leftmargin=10 topmargin=10>
<script language="javascript" src="scripts/titleband.js"
type=text/javascript></script>
<script language='javascript'>
function DoCarrierSelectChange(ASelect)
{
document.URL = "SaveCarrier.asp" + ASelect.value;
}
ClearTitleHtml();
AddTitleHtml("<span style='position:absolute;left:10;'>Change
Carrier</span>");
</script>
<center>
<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<td>
<table class='inner' border='0' cellpadding='2' cellspacing='1'>
<tr class='SUB_HEADER_ONE'>
<td colspan='2'>Change Carrier
<%
var vCarrierName = String(Request.Cookies("CarrierName"));
if (vCarrierName != "")
Response.write(" from " + vCarrierName);
%>
</td>
</tr>
<tr height="40" class='data_light'>
<td>
<table height='100%'>
<tr>
<td>Select a Carrier</td><td>
<%
Response.write('Session("securitytoken")=' + Session("SecurityToken") +
'<BR>');
Response.write("<select id='CarrierSelect'>\n");
ConnectDb();
BeginTrans();
vSQL =
'select '+
' C.carrier_id as ID, C.carrier_name as CName '+
'from '+
' security_token ST '+
' join user_carrier UC on UC.user_id = ST.user_id '+
' join carrier C on c.carrier_id = uc.carrier_id '+
'where '+
' st.security_token_id=' + Session("SecurityToken") + ' ' +
'order by '+
' C.carrier_name';
vCarrierList = ExecSQL(vSQL);
if (vCarrierList != null)
{
while (!vCarrierList.EOF)
{
Response.write(
"<option value='?id=" +
vCarrierList.Fields("ID").Value +
"&name=" +
vCarrierList.Fields("CName").Value);

if (String(vCarrierList.Fields("ID").Value) ==
String(Request.Cookies("CarrierId")))
Response.write("' selected>");
else
Response.write("'>");
Response.write(vCarrierList.Fields("CName").Value);
Response.write("</option>\n");
vCarrierList.Move(1);
}
}
else
Response.write('<option selected>Debug: Null result set</option>');
Commit();
DisconnectDb();
Response.write('</select>\n');
Response.write(' </td>\n');
Response.write(' </tr>\n');
Response.write(' </table>\n');
Response.write(' </td>\n');
Response.write(' </tr>\n');
Response.write(' </table>\n');
Response.write(' </td>\n');
Response.write(' </tr>\n');
Response.write(' <tr><td height="10"></td></tr>\n');
Response.write(' <tr height="34">\n');
Response.write(' <td colspan="2" class="buttons"
align="right">\n');
Response.write(' <button id=OkButton
onclick="DoCarrierSelectChange(CarrierSelect);"
style="width:75;margin-right:5;margin-left:5">Ok</button>\n');
Response.write(' </td>\n');
Response.write(' </tr>\n');
Response.write(' </table>\n');
Response.write(' </center>\n');
Response.write('</body>\n');
Response.write('</html>\n');
Response.End;
%>
 
D

Dave Anderson

Bob Murdoch said:
...
Response.End;

That should be Response.End(), though you could just leave this off.

Could you post the last few lines of generated source code?


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
W

William Morris

Bob,

I don't remember where I read this, but this is a known issue with IE.
Pages that contain client-side javascript will sometimes cause IE to get
"confused", and the progress bar never stops updating. There's nothing
wrong with your programming, and the page is finished loading.

I'm team lead on a rather large intranet project, and so far we haven't
found a workaround for it.

Best regards,

- Wm
 
D

Dave Anderson

William Morris said:
...There's nothing wrong with your programming, and
the page is finished loading...

I'm just curious -- have you ever tried document.close() ?


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
W

William Morris

Shoot, I've never even heard of document.close(). What is it? The
client-side equivalent of "response.end()?"

Incidentally, we have started adding response.end as the last line of every
top level ASP page. No results to report yet.
 
A

Aaron Bertrand - MVP

Incidentally, we have started adding response.end as the last line of
every
top level ASP page.

I'd be very surprised if that solved anything... the issue is with the
client-side code, not the server-side code.
 
B

Bob Murdoch

Dave Anderson said:
Could you post the last few lines of generated source code?

Absolutely. I'm assuming you mean the html source from the browser?

</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr><td height="10"></td></tr>
<tr height="34">
<td colspan="2" class="buttons" align="right">
<button id=OkButton
onclick="DoCarrierSelectChange(CarrierSelect);"
style="width:75;margin-right:5;margin-left:5">Ok</button>
</td>
</tr>
</table>
</center>
</body>
</html>
 
D

Dave Anderson

William Morris said:

Sort of. Response.End() flushes the response buffer and ends all variable
scope. document.close() closes the document stream and forces rendering. If
any of your included client-side JScript uses document.write(), you should
use document.close() to close the stream.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
D

Dave Anderson

I said:
If any of your included client-side JScript uses
document.write(), you should use document.close()
to close the stream.

Perhaps *should* is too strong a word. You *can* use it to close the stream.
I was just curious to know if doing so had any effect. I imagine you have to
be careful about where you use it, as it would seem to require that nothing
follow it. Perhaps in an ONLOAD handler?


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

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

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top