Hi;
I just wrote my first IHttpHandler and am having a problem. If the content
type is "text/html" then the below code works fine. But if it's "text/plain"
then my browser gets:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then
click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Invalid at the top level of the document. Error processing resource
'http://localhost:3179/portal/ShowReport.aspx'. Line 1...
hi there
^
url is: http://localhost:3179/portal/ShowReport.aspx
code (App_Code\ShowReport.cs) is:
using System.Web;
/// <summary>
/// Summary description for ShowReport
/// </summary>
public class ShowReport : IHttpHandler
{
public ShowReport()
{
}
#region IHttpHandler Members
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("hi there");
}
#endregion
}
web.config is:
<httpHandlers>
<add verb="*" path="ShowReport.aspx" type="ShowReport"/>
</httpHandlers>
???
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com