Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Stupid problem - Please help

I have to computers running IIS. Computer 1 has a directory with a .aspx file located in it. When I accress this page using http://localhost/directoryname the aspx file runs like it should.

Now, computer number 2. Same setup far as I can tell. Same directory in the wwwroot and same aspx file. I access on this computer http://localhost/directoryname and get an error:

HTTP 403: You are not authorized to view this page

So I try typing the full location pointing to the aspx file: http://localhost/directoryname/Default.aspx

This gives me the output of the script, however on computer number 1 when I run the script I get a download box asking me to save the xls file. This being the responce I want. What gives?

Content of aspx file:

<%@ Page Language="c#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<script language="C#" runat="server">
public void Page_Load(Object sender, EventArgs E) {
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("KFMY.xml"));
XmlDataDocument xdd = new XmlDataDocument(ds);
XslTransform xt = new XslTransform();
xt.Load(Server.MapPath("Excel.xsl"));
xt.Transform(xdd, null, Response.OutputStream);
Response.End();
}
</script>
[1558 byte] By [Jleemc44] at [2007-11-11 10:06:25]
# 1 Re: Stupid problem - Please help
I think I have part of this problem figured out. It seems if you dont have Microsoft Excel installed you will not be prompted to download the file. I cant test this but I noticed when I acceess the Default.aspx from the browser of another computer I do get the download box and not the scripts output like on the server.

However, why does the script not run with just the directory accessed (http://localhost/directoryname) when it works on the first computer?
Jleemc44 at 2007-11-11 23:12:04 >