why does Response.ContentType = "text/plain"; not work correctly?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs"
Inherits="Default2" %>

public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "text/plain";
Response.Write("help");
}
}

Invalid at the top level of the document. Error processing resource
'http://localhost/aplus/Default2.aspx'. Line 1, Positi...

help
 
Letuce,
this inline script page works fine for me:


<%@ Page Language="C#" %>
<script runat=server>
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "text/plain";
Response.Write("help");
}
</script>

--Peter
 
letuce said:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs"
Inherits="Default2" %>

public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "text/plain";
Response.Write("help");
}
}

Invalid at the top level of the document. Error processing resource
'http://localhost/aplus/Default2.aspx'. Line 1, Positi...

help

When and where do you get the error message?
 
I have 2 machines imaged exactly the same and one works just fine and the
other does not.

I have several other people at my location and it's about 50-50 works doen't
work with them as well.

it's got to be some type of IE specific security/mime setting.

why would the mime type think text/plain is xml? strange?
 
Back
Top