473,883 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening ASP page causes file download dialog instead

I have an issue with a particular ASP page on two web servers. Let's
call these servers Dev1 and Beta1. Both Servers are running IIS 5,
Windows 2000 SP4 with "almost" all of the latest patches.

On Beta1, I am able to execute a particular page with no problem, that
page opens up in the comes up just fine.

On Win2kdev1, when I go to execute the same page, it opens a file
download dialog and asks me whether I want to open or save the "file".
Other ASP pages in the same directory display correctly. As far as I
can tell, there is nothing obviously different between these working
pages and the ASP page which causes the download dialog to open. The
filetypes are all .ASP.

I have verified that the app mappings (in IIS Manager,
Directory/Configuration/App Mappings) are correctly set to point to
asp.dll. I have removed and reset the app mapping just in case, but
still get the same error. The problem can arise on a different page
by doing something as trivial as changing some text and saving the
page.

I have compared file permissions on the file on both servers and they
are exactly the same. I thought something was wrong with the page on
Win2kDev1, so I copied over the page from Beta1. Same problem. I
have checked the IIS logs, and I do not see any errors in the
ex060120.log (for the last date that I tested this).

Does anyone have any ideas for anything I can look at to try to figure
out this issue? TIA.

-- Neil Rossi
Jan 26 '06 #1
5 12325
For the page that causes the file download dialog, use WFetch to make the
same request and post the raw response.

http://www.microsoft.com/downloads/d...displaylang=en

If it happens on random pages and not specific pages, then I would not look
at Application Mapping (which would be consistent) nor the script in the
page (which would be consistent unless the problem is server-specific).

Also, can you report the Global and Site ISAPI Filters installed on both
machines.

My suspicion right now is that some ISAPI Filter is mistakenly adding
certain response headers to ASP pages such that the browser asks to download
the page instead of displaying it.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

"Neil Rossi" <ro***@kdvsyste ms.com> wrote in message
news:9q******** *************** *********@4ax.c om...
I have an issue with a particular ASP page on two web servers. Let's
call these servers Dev1 and Beta1. Both Servers are running IIS 5,
Windows 2000 SP4 with "almost" all of the latest patches.

On Beta1, I am able to execute a particular page with no problem, that
page opens up in the comes up just fine.

On Win2kdev1, when I go to execute the same page, it opens a file
download dialog and asks me whether I want to open or save the "file".
Other ASP pages in the same directory display correctly. As far as I
can tell, there is nothing obviously different between these working
pages and the ASP page which causes the download dialog to open. The
filetypes are all .ASP.

I have verified that the app mappings (in IIS Manager,
Directory/Configuration/App Mappings) are correctly set to point to
asp.dll. I have removed and reset the app mapping just in case, but
still get the same error. The problem can arise on a different page
by doing something as trivial as changing some text and saving the
page.

I have compared file permissions on the file on both servers and they
are exactly the same. I thought something was wrong with the page on
Win2kDev1, so I copied over the page from Beta1. Same problem. I
have checked the IIS logs, and I do not see any errors in the
ex060120.log (for the last date that I tested this).

Does anyone have any ideas for anything I can look at to try to figure
out this issue? TIA.

-- Neil Rossi

Jan 27 '06 #2
Thanks for your response, David. There are, as far as I can see, no
ISAPI filters defined within INetMgr, either for this specific website
or at the Default website level.

Just for the heck of it, I logged in to the remote server and ran the
app throwing the error using localhost. Now I see that the page
showing the download dialog on a remote client, is actually displaying
a "500 Internal Server Error" when logged in to the IIS server.

Here's the log output from WFetch run on the server Win2kDev1. I am
trying to load the page final.asp, so this error page doesn't seem to
give me much info.
------------------------------
started....
WWWConnect::Con nect("localhost ","443")\n
source port: 2065\r\n
REQUEST: **************\ n
GET /onlineservices/grantapp/final.asp HTTP/1.1\r\n
Host: localhost\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\ n
HTTP/1.1 200 OK\r\n
Server: Microsoft-IIS/5.0\r\n
Date: Fri, 27 Jan 2006 18:30:47 GMT\r\n
Connection: close\r\n
Content-Type: application/octet-stream\r\n
Cache-control: private\r\n
Content-Length: 7860\r\n
\r\n
<%@ language="VBScr ipt" %>\r\n
<%\r\n
Option Explicit\r\n
\r\n
Const lngMaxFormBytes = 200\r\n
\r\n
Dim objASPError, blnErrorWritten , strServername, strServerIP,
strRemoteIP\r\n
Dim strMethod, lngPos, datNow, strQueryString, strURL\r\n
\r\n
If Response.Buffer Then\r\n
Response.Clear\ r\n
Response.Status = "500 Internal Server Error"\r\n
Response.Conten tType = "text/html"\r\n
Response.Expire s = 0\r\n
End If\r\n
\r\n
Set objASPError = Server.GetLastE rror\r\n
%>\r\n
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\r\n
\r\n
<html dir=ltr>\r\n
\r\n
<head>\r\n
<style>\r\n
a:link\t\t\t{fo nt:8pt/11pt verdana; color:FF0000}\r \n
a:visited\t\t{f ont:8pt/11pt verdana; color:#4e4e4e}\ r\n
</style>\r\n
\r\n
<META NAME="ROBOTS" CONTENT="NOINDE X">\r\n
\r\n
<title>The page cannot be displayed</title>\r\n
\r\n
<META HTTP-EQUIV="Content-Type" Content="text-html;
charset=Windows-1252">\r\n
</head>\r\n
\r\n
<script> \r\n
function Homepage(){\r\n
<!--\r\n
// in real bits, urls get returned to our script like this:\r\n
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm \r\n
\r\n
\t//For testing use DocURL =
"res://shdocvw.dll/http_404.htm#ht tps://www.microsoft.c om/bar.htm"\r\n
\tDocURL=docume nt.URL;\r\n
\t\r\n
\t//this is where the http or https will be, as found by searching for
:// but skipping the res://\r\n
\tprotocolIndex =DocURL.indexOf ("://",4);\r\n
\t\r\n
\t//this finds the ending slash for the domain server \r\n
\tserverIndex=D ocURL.indexOf("/",protocolI ndex + 3);\r\n
\r\n
\t//for the href, we need a valid URL to the domain. We search for the
# symbol to find the begining \r\n
\t//of the true URL, and add 1 to skip it - this is the BeginURL
value. We use serverIndex as the end marker.\r\n
\t//urlresult=DocUR L.substring(pro tocolIndex - 4,serverIndex); \r\n
\tBeginURL=DocU RL.indexOf("#", 1) + 1;\r\n
\turlresult=Doc URL.substring(B eginURL,serverI ndex);\r\n
\t\t\r\n
\t//for display, we need to skip after http://, and go to the next
slash\r\n
\tdisplayresult =DocURL.substri ng(protocolInde x + 3 ,serverIndex);\ r\n
\tInsertElement Anchor(urlresul t, displayresult); \r\n
}\r\n
\r\n
function HtmlEncode(text )\r\n
{\r\n
return text.replace(/&/g, '&amp').replace (/'/g,
'&quot;').repla ce(/</g, '&lt;').replace (/>/g, '&gt;');\r\n
}\r\n
\r\n
function TagAttrib(name, value)\r\n
{\r\n
return ' '+name+'="'+Htm lEncode(value)+ '"';\r\n
}\r\n
\r\n
function PrintTag(tagNam e, needCloseTag, attrib, inner){\r\n
document.write( '<' + tagName + attrib + '>' + HtmlEncode(inne r)
);\r\n
if (needCloseTag) document.write( '</' + tagName +'>' );\r\n
}\r\n
\r\n
function URI(href)\r\n
{\r\n
IEVer = window.navigato r.appVersion;\r \n
IEVer = IEVer.substr( IEVer.indexOf(' MSIE') + 5, 3 );\r\n
\r\n
return (IEVer.charAt(1 )=='.' && IEVer >= '5.5') ?\r\n
encodeURI(href) :\r\n
escape(href).re place(/%3A/g, ':').replace(/%3B/g, ';');\r\n
}\r\n
\r\n
function InsertElementAn chor(href, text)\r\n
{\r\n
PrintTag('A', true, TagAttrib('HREF ', URI(href)), text);\r\n
}\r\n
\r\n
//-->\r\n
</script>\r\n
\r\n
<body bgcolor="FFFFFF ">\r\n
\r\n
<table width="410" cellpadding="3" cellspacing="5" >\r\n
\r\n
<tr> \r\n
<td align="left" valign="middle" width="360">\r\ n
\t<h1 style="COLOR:00 0000; FONT: 13pt/15pt verdana"><!--Problem-->The
page cannot be displayed</h1>\r\n
</td>\r\n
</tr>\r\n
\r\n
<tr>\r\n
<td width="400" colspan="2">\r\ n
\t<font style="COLOR:00 0000; FONT: 8pt/11pt verdana">There is a
problem with the page you are trying to reach and it cannot be
displayed.</font></td>\r\n
</tr>\r\n
\r\n
<tr>\r\n
<td width="400" colspan="2">\r\ n
\t<font style="COLOR:00 0000; FONT: 8pt/11pt verdana">\r\n
\r\n
\t<hr color="#C0C0C0" noshade>\r\n
\t\r\n
<p>Please try the following:</p>\r\n
\r\n
\t<ul>\r\n
<li id="instruction sText1">Click the \r\n
<a href="javascrip t:location.relo ad()">\r\n
Refresh</a> button, or try again later.<br>\r\n
</li>\r\n
\t \r\n
<li>Open the \r\n
\t \r\n
\t <script>\r\n
\t <!--\r\n
\t if (!((window.navi gator.userAgent .indexOf("MSIE" ) > 0) &&
(window.navigat or.appVersion.c harAt(0) == "2")))\r\n
\t {\r\n
\t \t Homepage();\r\n
\t }\r\n
\t //-->\r\n
\t </script>\r\n
\r\n
\t home page, and then look for links to the information you want.
</li>\r\n
</ul>\r\n
\t\r\n
<h2 style="font:8pt/11pt verdana; color:000000">H TTP 500.100 -
Internal Server\r\n
Error - ASP error<br>\r\n
Internet Information Services</h2>\r\n
\r\n
\t<hr color="#C0C0C0" noshade>\r\n
\t\r\n
\t<p>Technical Information (for support personnel)</p>\r\n
\r\n
<ul>\r\n
<li>Error Type:<br>\r\n
<%\r\n
Dim bakCodepage\r\n
on error resume next\r\n
\t bakCodepage = Session.Codepag e\r\n
\t Session.Codepag e = 1252\r\n
on error goto 0\r\n
Response.Write Server.HTMLEnco de(objASPError. Category)\r\n
If objASPError.ASP Code > "" Then Response.Write Server.HTMLEnco de(",
" & objASPError.ASP Code)\r\n
Response.Write Server.HTMLEnco de(" (0x" & Hex(objASPError .Number) &
")" ) & "<br>"\r\n
\r\n
If objASPError.ASP Description > "" Then \r\n
\t\tResponse.Wr ite Server.HTMLEnco de(objASPError. ASPDescription) &
"<br>"\r\n
\r\n
elseIf (objASPError.De scription > "") Then \r\n
\t\t Response.Write Server.HTMLEnco de(objASPError. Description) &
"<br>" \r\n
end if\r\n
\r\n
\r\n
\r\n
blnErrorWritten = False\r\n
\r\n
' Only show the Source if it is available and the request is from
the same machine as IIS\r\n
If objASPError.Sou rce > "" Then\r\n
strServername = LCase(Request.S erverVariables( "SERVER_NAME")) \r\n
strServerIP = Request.ServerV ariables("LOCAL _ADDR")\r\n
strRemoteIP = Request.ServerV ariables("REMOT E_ADDR")\r\n
If (strServername = "localhost" Or strServerIP = strRemoteIP) And
objASPError.Fil e <> "?" Then\r\n
Response.Write Server.HTMLEnco de(objASPError. File)\r\n
If objASPError.Lin e > 0 Then Response.Write ", line " &
objASPError.Lin e\r\n
If objASPError.Col umn > 0 Then Response.Write ", column " &
objASPError.Col umn\r\n
Response.Write "<br>"\r\n
Response.Write "<font style=""COLOR:0 00000; FONT: 8pt/11pt
courier new""><b>"\r\n
Response.Write Server.HTMLEnco de(objASPError. Source) &
"<br>"\r\n
If objASPError.Col umn > 0 Then Response.Write
String((objASPE rror.Column - 1), "-") & "^<br>"\r\n
Response.Write "</b></font>"\r\n
blnErrorWritten = True\r\n
End If\r\n
End If\r\n
\r\n
If Not blnErrorWritten And objASPError.Fil e <> "?" Then\r\n
Response.Write "<b>" & Server.HTMLEnco de( objASPError.Fil e)\r\n
If objASPError.Lin e > 0 Then Response.Write Server.HTMLEnco de(",
line " & objASPError.Lin e)\r\n
If objASPError.Col umn > 0 Then Response.Write ", column " &
objASPError.Col umn\r\n
Response.Write "</b><br>"\r\n
End If\r\n
%>\r\n
</li>\r\n
<p>\r\n
<li>Browser Type:<br>\r\n
<%= Server.HTMLEnco de(Request.Serv erVariables("HT TP_USER_AGENT") )
%>\r\n
</li>\r\n
<p>\r\n
<li>Page:<br>\r \n
<%\r\n
strMethod = Request.ServerV ariables("REQUE ST_METHOD")\r\n
\r\n
Response.Write strMethod & " "\r\n
\r\n
If strMethod = "POST" Then\r\n
Response.Write Request.TotalBy tes & " bytes to "\r\n
End If\r\n
\r\n
Response.Write Request.ServerV ariables("SCRIP T_NAME")\r\n
\r\n
lngPos = InStr(Request.Q ueryString, "|")\r\n
\r\n
If lngPos > 1 Then\r\n
Response.Write "?" & Server.HTMLEnco de(Left(Request .QueryString,
(lngPos - 1)))\r\n
End If\r\n
\r\n
Response.Write "</li>"\r\n
\r\n
If strMethod = "POST" Then\r\n
Response.Write "<p><li>POS T Data:<br>"\r\n
If Request.TotalBy tes > lngMaxFormBytes Then\r\n
Response.Write Server.HTMLEnco de(Left(Request .Form,
lngMaxFormBytes )) & " . . ."\r\n
Else\r\n
Response.Write Server.HTMLEnco de(Request.Form )\r\n
End If\r\n
Response.Write "</li>"\r\n
End If\r\n
\r\n
%>\r\n
<p>\r\n
<li>Time:<br>\r \n
<%\r\n
datNow = Now()\r\n
\r\n
Response.Write Server.HTMLEnco de(FormatDateTi me(datNow, 1) & ", " &
FormatDateTime( datNow, 3))\r\n
on error resume next\r\n
\t Session.Codepag e = bakCodepage \r\n
on error goto 0\r\n
%>\r\n
</li>\r\n
</p>\r\n
<p>\r\n
<li>More information:<br >\r\n
<% strQueryString = "prd=iis&sbp=&p ver=5.0&ID=500; 100&cat=" &
Server.URLEncod e(objASPError.C ategory) & _\r\n
"&os=&over=&hrd =&Opt1=" & Server.URLEncod e(objASPError.A SPCode) &
"&Opt2=" & Server.URLEncod e(objASPError.N umber) & _\r\n
"&Opt3=" & Server.URLEncod e(objASPError.D escription) \r\n
strURL = "http://www.microsoft.c om/ContentRedirect .asp?" &
_\r\n
strQueryString\ r\n
%>\r\n
<a href="<%= strURL %
">Microsoft Support</a>\r\n </li>\r\n
</p>\r\n
\r\n
</font></td>\r\n
</tr>\r\n
\r\n
</table>\r\n
</body>\r\n
</html>\r\n
WWWConnect::Clo se("localhost", "443")\n
closed source port: 2065\r\n
finished.

=============== ============
On Fri, 27 Jan 2006 00:12:03 -0800, "David Wang [Msft]"
<so*****@online .microsoft.com> wrote:
For the page that causes the file download dialog, use WFetch to make the
same request and post the raw response.

http://www.microsoft.com/downloads/d...displaylang=en

If it happens on random pages and not specific pages, then I would not look
at Application Mapping (which would be consistent) nor the script in the
page (which would be consistent unless the problem is server-specific).

Also, can you report the Global and Site ISAPI Filters installed on both
machines.

My suspicion right now is that some ISAPI Filter is mistakenly adding
certain response headers to ASP pages such that the browser asks to download
the page instead of displaying it.

Jan 27 '06 #3
/onlineservices/grantapp/final.asp is being treated as a static file and
downloaded verbatim (<% %> is still there) instead of as a dynamic ASP file
that is executed to generate a HTML response.

Assuming no ISAPI Filter, this means either:
1. .asp does not exist as an Application Mapping for this URL resource
2. Execute permission is "None" for this URL resource

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

"Neil Rossi" <ro***@kdvsyste ms.com> wrote in message
news:lt******** *************** *********@4ax.c om...
Thanks for your response, David. There are, as far as I can see, no
ISAPI filters defined within INetMgr, either for this specific website
or at the Default website level.

Just for the heck of it, I logged in to the remote server and ran the
app throwing the error using localhost. Now I see that the page
showing the download dialog on a remote client, is actually displaying
a "500 Internal Server Error" when logged in to the IIS server.

Here's the log output from WFetch run on the server Win2kDev1. I am
trying to load the page final.asp, so this error page doesn't seem to
give me much info.
------------------------------
started....
WWWConnect::Con nect("localhost ","443")\n
source port: 2065\r\n
REQUEST: **************\ n
GET /onlineservices/grantapp/final.asp HTTP/1.1\r\n
Host: localhost\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\ n
HTTP/1.1 200 OK\r\n
Server: Microsoft-IIS/5.0\r\n
Date: Fri, 27 Jan 2006 18:30:47 GMT\r\n
Connection: close\r\n
Content-Type: application/octet-stream\r\n
Cache-control: private\r\n
Content-Length: 7860\r\n
\r\n
<%@ language="VBScr ipt" %>\r\n
<%\r\n
Option Explicit\r\n
\r\n
Const lngMaxFormBytes = 200\r\n
\r\n
Dim objASPError, blnErrorWritten , strServername, strServerIP,
strRemoteIP\r\n
Dim strMethod, lngPos, datNow, strQueryString, strURL\r\n
\r\n
If Response.Buffer Then\r\n
Response.Clear\ r\n
Response.Status = "500 Internal Server Error"\r\n
Response.Conten tType = "text/html"\r\n
Response.Expire s = 0\r\n
End If\r\n
\r\n
Set objASPError = Server.GetLastE rror\r\n
%>\r\n
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\r\n
\r\n
<html dir=ltr>\r\n
\r\n
<head>\r\n
<style>\r\n
a:link\t\t\t{fo nt:8pt/11pt verdana; color:FF0000}\r \n
a:visited\t\t{f ont:8pt/11pt verdana; color:#4e4e4e}\ r\n
</style>\r\n
\r\n
<META NAME="ROBOTS" CONTENT="NOINDE X">\r\n
\r\n
<title>The page cannot be displayed</title>\r\n
\r\n
<META HTTP-EQUIV="Content-Type" Content="text-html;
charset=Windows-1252">\r\n
</head>\r\n
\r\n
<script> \r\n
function Homepage(){\r\n
<!--\r\n
// in real bits, urls get returned to our script like this:\r\n
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm \r\n
\r\n
\t//For testing use DocURL =
"res://shdocvw.dll/http_404.htm#ht tps://www.microsoft.c om/bar.htm"\r\n
\tDocURL=docume nt.URL;\r\n
\t\r\n
\t//this is where the http or https will be, as found by searching for
:// but skipping the res://\r\n
\tprotocolIndex =DocURL.indexOf ("://",4);\r\n
\t\r\n
\t//this finds the ending slash for the domain server \r\n
\tserverIndex=D ocURL.indexOf("/",protocolI ndex + 3);\r\n
\r\n
\t//for the href, we need a valid URL to the domain. We search for the
# symbol to find the begining \r\n
\t//of the true URL, and add 1 to skip it - this is the BeginURL
value. We use serverIndex as the end marker.\r\n
\t//urlresult=DocUR L.substring(pro tocolIndex - 4,serverIndex); \r\n
\tBeginURL=DocU RL.indexOf("#", 1) + 1;\r\n
\turlresult=Doc URL.substring(B eginURL,serverI ndex);\r\n
\t\t\r\n
\t//for display, we need to skip after http://, and go to the next
slash\r\n
\tdisplayresult =DocURL.substri ng(protocolInde x + 3 ,serverIndex);\ r\n
\tInsertElement Anchor(urlresul t, displayresult); \r\n
}\r\n
\r\n
function HtmlEncode(text )\r\n
{\r\n
return text.replace(/&/g, '&amp').replace (/'/g,
'&quot;').repla ce(/</g, '&lt;').replace (/>/g, '&gt;');\r\n
}\r\n
\r\n
function TagAttrib(name, value)\r\n
{\r\n
return ' '+name+'="'+Htm lEncode(value)+ '"';\r\n
}\r\n
\r\n
function PrintTag(tagNam e, needCloseTag, attrib, inner){\r\n
document.write( '<' + tagName + attrib + '>' + HtmlEncode(inne r)
);\r\n
if (needCloseTag) document.write( '</' + tagName +'>' );\r\n
}\r\n
\r\n
function URI(href)\r\n
{\r\n
IEVer = window.navigato r.appVersion;\r \n
IEVer = IEVer.substr( IEVer.indexOf(' MSIE') + 5, 3 );\r\n
\r\n
return (IEVer.charAt(1 )=='.' && IEVer >= '5.5') ?\r\n
encodeURI(href) :\r\n
escape(href).re place(/%3A/g, ':').replace(/%3B/g, ';');\r\n
}\r\n
\r\n
function InsertElementAn chor(href, text)\r\n
{\r\n
PrintTag('A', true, TagAttrib('HREF ', URI(href)), text);\r\n
}\r\n
\r\n
//-->\r\n
</script>\r\n
\r\n
<body bgcolor="FFFFFF ">\r\n
\r\n
<table width="410" cellpadding="3" cellspacing="5" >\r\n
\r\n
<tr> \r\n
<td align="left" valign="middle" width="360">\r\ n
\t<h1 style="COLOR:00 0000; FONT: 13pt/15pt verdana"><!--Problem-->The
page cannot be displayed</h1>\r\n
</td>\r\n
</tr>\r\n
\r\n
<tr>\r\n
<td width="400" colspan="2">\r\ n
\t<font style="COLOR:00 0000; FONT: 8pt/11pt verdana">There is a
problem with the page you are trying to reach and it cannot be
displayed.</font></td>\r\n
</tr>\r\n
\r\n
<tr>\r\n
<td width="400" colspan="2">\r\ n
\t<font style="COLOR:00 0000; FONT: 8pt/11pt verdana">\r\n
\r\n
\t<hr color="#C0C0C0" noshade>\r\n
\t\r\n
<p>Please try the following:</p>\r\n
\r\n
\t<ul>\r\n
<li id="instruction sText1">Click the \r\n
<a href="javascrip t:location.relo ad()">\r\n
Refresh</a> button, or try again later.<br>\r\n
</li>\r\n
\t \r\n
<li>Open the \r\n
\t \r\n
\t <script>\r\n
\t <!--\r\n
\t if (!((window.navi gator.userAgent .indexOf("MSIE" ) > 0) &&
(window.navigat or.appVersion.c harAt(0) == "2")))\r\n
\t {\r\n
\t \t Homepage();\r\n
\t }\r\n
\t //-->\r\n
\t </script>\r\n
\r\n
\t home page, and then look for links to the information you want.
</li>\r\n
</ul>\r\n
\t\r\n
<h2 style="font:8pt/11pt verdana; color:000000">H TTP 500.100 -
Internal Server\r\n
Error - ASP error<br>\r\n
Internet Information Services</h2>\r\n
\r\n
\t<hr color="#C0C0C0" noshade>\r\n
\t\r\n
\t<p>Technical Information (for support personnel)</p>\r\n
\r\n
<ul>\r\n
<li>Error Type:<br>\r\n
<%\r\n
Dim bakCodepage\r\n
on error resume next\r\n
\t bakCodepage = Session.Codepag e\r\n
\t Session.Codepag e = 1252\r\n
on error goto 0\r\n
Response.Write Server.HTMLEnco de(objASPError. Category)\r\n
If objASPError.ASP Code > "" Then Response.Write Server.HTMLEnco de(",
" & objASPError.ASP Code)\r\n
Response.Write Server.HTMLEnco de(" (0x" & Hex(objASPError .Number) &
")" ) & "<br>"\r\n
\r\n
If objASPError.ASP Description > "" Then \r\n
\t\tResponse.Wr ite Server.HTMLEnco de(objASPError. ASPDescription) &
"<br>"\r\n
\r\n
elseIf (objASPError.De scription > "") Then \r\n
\t\t Response.Write Server.HTMLEnco de(objASPError. Description) &
"<br>" \r\n
end if\r\n
\r\n
\r\n
\r\n
blnErrorWritten = False\r\n
\r\n
' Only show the Source if it is available and the request is from
the same machine as IIS\r\n
If objASPError.Sou rce > "" Then\r\n
strServername = LCase(Request.S erverVariables( "SERVER_NAME")) \r\n
strServerIP = Request.ServerV ariables("LOCAL _ADDR")\r\n
strRemoteIP = Request.ServerV ariables("REMOT E_ADDR")\r\n
If (strServername = "localhost" Or strServerIP = strRemoteIP) And
objASPError.Fil e <> "?" Then\r\n
Response.Write Server.HTMLEnco de(objASPError. File)\r\n
If objASPError.Lin e > 0 Then Response.Write ", line " &
objASPError.Lin e\r\n
If objASPError.Col umn > 0 Then Response.Write ", column " &
objASPError.Col umn\r\n
Response.Write "<br>"\r\n
Response.Write "<font style=""COLOR:0 00000; FONT: 8pt/11pt
courier new""><b>"\r\n
Response.Write Server.HTMLEnco de(objASPError. Source) &
"<br>"\r\n
If objASPError.Col umn > 0 Then Response.Write
String((objASPE rror.Column - 1), "-") & "^<br>"\r\n
Response.Write "</b></font>"\r\n
blnErrorWritten = True\r\n
End If\r\n
End If\r\n
\r\n
If Not blnErrorWritten And objASPError.Fil e <> "?" Then\r\n
Response.Write "<b>" & Server.HTMLEnco de( objASPError.Fil e)\r\n
If objASPError.Lin e > 0 Then Response.Write Server.HTMLEnco de(",
line " & objASPError.Lin e)\r\n
If objASPError.Col umn > 0 Then Response.Write ", column " &
objASPError.Col umn\r\n
Response.Write "</b><br>"\r\n
End If\r\n
%>\r\n
</li>\r\n
<p>\r\n
<li>Browser Type:<br>\r\n
<%= Server.HTMLEnco de(Request.Serv erVariables("HT TP_USER_AGENT") )
%>\r\n
</li>\r\n
<p>\r\n
<li>Page:<br>\r \n
<%\r\n
strMethod = Request.ServerV ariables("REQUE ST_METHOD")\r\n
\r\n
Response.Write strMethod & " "\r\n
\r\n
If strMethod = "POST" Then\r\n
Response.Write Request.TotalBy tes & " bytes to "\r\n
End If\r\n
\r\n
Response.Write Request.ServerV ariables("SCRIP T_NAME")\r\n
\r\n
lngPos = InStr(Request.Q ueryString, "|")\r\n
\r\n
If lngPos > 1 Then\r\n
Response.Write "?" & Server.HTMLEnco de(Left(Request .QueryString,
(lngPos - 1)))\r\n
End If\r\n
\r\n
Response.Write "</li>"\r\n
\r\n
If strMethod = "POST" Then\r\n
Response.Write "<p><li>POS T Data:<br>"\r\n
If Request.TotalBy tes > lngMaxFormBytes Then\r\n
Response.Write Server.HTMLEnco de(Left(Request .Form,
lngMaxFormBytes )) & " . . ."\r\n
Else\r\n
Response.Write Server.HTMLEnco de(Request.Form )\r\n
End If\r\n
Response.Write "</li>"\r\n
End If\r\n
\r\n
%>\r\n
<p>\r\n
<li>Time:<br>\r \n
<%\r\n
datNow = Now()\r\n
\r\n
Response.Write Server.HTMLEnco de(FormatDateTi me(datNow, 1) & ", " &
FormatDateTime( datNow, 3))\r\n
on error resume next\r\n
\t Session.Codepag e = bakCodepage \r\n
on error goto 0\r\n
%>\r\n
</li>\r\n
</p>\r\n
<p>\r\n
<li>More information:<br >\r\n
<% strQueryString = "prd=iis&sbp=&p ver=5.0&ID=500; 100&cat=" &
Server.URLEncod e(objASPError.C ategory) & _\r\n
"&os=&over=&hrd =&Opt1=" & Server.URLEncod e(objASPError.A SPCode) &
"&Opt2=" & Server.URLEncod e(objASPError.N umber) & _\r\n
"&Opt3=" & Server.URLEncod e(objASPError.D escription) \r\n
strURL = "http://www.microsoft.c om/ContentRedirect .asp?" &
_\r\n
strQueryString\ r\n
%>\r\n
<a href="<%= strURL %
">Microsoft Support</a>\r\n

</li>\r\n
</p>\r\n
\r\n
</font></td>\r\n
</tr>\r\n
\r\n
</table>\r\n
</body>\r\n
</html>\r\n
WWWConnect::Clo se("localhost", "443")\n
closed source port: 2065\r\n
finished.

=============== ============
On Fri, 27 Jan 2006 00:12:03 -0800, "David Wang [Msft]"
<so*****@online .microsoft.com> wrote:
For the page that causes the file download dialog, use WFetch to make the
same request and post the raw response.

http://www.microsoft.com/downloads/d...displaylang=en

If it happens on random pages and not specific pages, then I would not
look
at Application Mapping (which would be consistent) nor the script in the
page (which would be consistent unless the problem is server-specific).

Also, can you report the Global and Site ISAPI Filters installed on both
machines.

My suspicion right now is that some ISAPI Filter is mistakenly adding
certain response headers to ASP pages such that the browser asks to
download
the page instead of displaying it.

Feb 1 '06 #4
Thank you, David. I just checked, and Execute permissions for the
default web site as well as Online Services (the misbehaving site)
virtual directory is set to Scripts Only.

..asp is an application mapping for both the Default Web site as well
as Online Services. I just checked Beta1 and it was configured
exactly the same as on the Win2kDev1 server. I am running out of
things to check. It is as if the application mapping was being
ignored for _specific_ files within the site. Am I correct in
assuming that the mapping is determined only by the file extension
(.asp) and not the content of the file?

On Wed, 1 Feb 2006 01:46:37 -0800, "David Wang [Msft]"
<so*****@online .microsoft.com> wrote:
/onlineservices/grantapp/final.asp is being treated as a static file and
downloaded verbatim (<% %> is still there) instead of as a dynamic ASP file
that is executed to generate a HTML response.

Assuming no ISAPI Filter, this means either:
1. .asp does not exist as an Application Mapping for this URL resource
2. Execute permission is "None" for this URL resource

Feb 2 '06 #5
Here's the solution. It required a paid support call to MS, but maybe
this will save somebody else some aggravation.

There were actually two problems. First, the custom error defined for
error 500;100 (internal server error; ASP error) in
C:\WINNT\help\i isHelp\common seems to have become corrupted. It was
not being recognized as a valid HTML or ASP page, and so prompted a
download dialog on the client (it displayed the source text if it was
run on Win2kDev1 under localhost).

*That* error was being caused by an out-of-date ASP include file which
was loading a dictionary object of loan types. We never saw that
error because it was being masked by the corrupted custom error page,
which displayed as a text file. The MS support person suggested
working around the bad error page by clicking “Set to default” in
InetMgr when you highlight the 500;100 error page. Once that was
done, the bad include file was immediately apparent and was a simple
fix.

But we still wasted several man-days trying to track it down! All
errors are simple once you figure them out.

On Thu, 02 Feb 2006 09:11:56 -0500, Neil Rossi <ro***@kdvsyste ms.com>
wrote:
Thank you, David. I just checked, and Execute permissions for the
default web site as well as Online Services (the misbehaving site)
virtual directory is set to Scripts Only.

.asp is an application mapping for both the Default Web site as well
as Online Services. I just checked Beta1 and it was configured
exactly the same as on the Win2kDev1 server. I am running out of
things to check. It is as if the application mapping was being
ignored for _specific_ files within the site. Am I correct in
assuming that the mapping is determined only by the file extension
(.asp) and not the content of the file?

On Wed, 1 Feb 2006 01:46:37 -0800, "David Wang [Msft]"
<so*****@onlin e.microsoft.com > wrote:
/onlineservices/grantapp/final.asp is being treated as a static file and
downloaded verbatim (<% %> is still there) instead of as a dynamic ASP file
that is executed to generate a HTML response.

Assuming no ISAPI Filter, this means either:
1. .asp does not exist as an Application Mapping for this URL resource
2. Execute permission is "None" for this URL resource

Feb 7 '06 #6

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

Similar topics

1
2368
by: Don Peters | last post by:
I'm relatively new to ASP.NET. I'm running it under Win XP Pro, using Visual Studio 2002.NET (haven't migrated to VS2003 yet). The ASP.NET application I'm having a problem with was initially set up on a laptop running Win2000, where it ran successfully. I've copied all the files over to my desktop, intending to support it there. But it seems to have a problem upon startup: instead of initially displaying the starting ASP.NET page as it...
3
2831
by: skyetech | last post by:
We're creating a file sharing area in our intranet. When a user clicks on a link they can save the file to their computer. When the file is done downloading and the 'File Download' dialog closes I want to update the database to flag that file as checked out. Because we don't want anyone else to download it until the file has been re-uploaded. Does anyone know how I can know when the dialog closes? It would also be good to know if the...
2
2099
by: Peter | last post by:
Hi! Please, could anybody advice me, is it possible to disable file download dialog in ASP.NET page or just save button in the file download dialog so that user should only open for example word document? Thanks Peter
4
1761
by: Vikram | last post by:
i am using following code in button click... of asp.net code behind page Response.Clear() 'clears the current output content from the buffer Response.AppendHeader("Content-Disposition", _ "attachment; filename=Add2Calendar.vbs") Response.AppendHeader("Content-Length", mStream.Length.ToString())
3
2072
by: Uncle_Bob | last post by:
Hello all! I'm writing a simple C# application, that should day by day open a particular web site and download a text file (new file is generated by the server daily). I'm using Microsoft Web Browser ActiveX, and I cannot simply provide the file URL in my app, because of: 1) First, I should provide credentials to enter the site
2
2634
by: Mark Anderson | last post by:
Is it possible to identify the action of a user cancelling by the user of file download dialog? (as opposed to something else being captured. Ideally I'd like to do this for a IE6+/FF v1.5+/Safari v1.2+ base. [I've a pass through ASP page capturing calls to a download component that doesn't logs activity and which I can't edit. As my ASP page logs the calls before download, a cancel by the user means the d/l count is 1 too high. As this...
1
1974
by: ckarbass | last post by:
I'd like for the file download dialog to be launched upon page load. The workflow or behavior is exactly the same as sourceforge's. I've searched on google to no avail. Any help would be appreciated. Thanks.
1
1762
by: sunita | last post by:
Hiii I open a file download dialog from a modal dialog...From the file download dialog i can either save or open the file.. Is there a way i can let the modal dialog that opens the file download dialog know whether the user has clicked on the open button or the save button of the file download dialog??
1
2298
by: RN1 | last post by:
In an ASP.NET app, users can upload their files to a remote server as back-up. I want to give users the provision to download files that they have uploaded to the remote server to their local machine. This is how I am invoking the file download dialog box that pops up in IE6 (users click a Button): Sub btn_DwnldFile(ByVal obj As Object, ByVal ea As EventArgs) Dim strURL As String = 'getting the file name Response.ContentType =...
0
9932
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9778
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10833
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10405
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7959
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4602
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3228
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.