page 1 of 1
Comments: 4 | Views: 871
turrican
turrican
Condemnation without investigation is the height of ignorance! - Albert Einstein

I have a website created in Visual Web Developer. It has index.aspx and index.aspx.cs. I also got a SomeClass.cs with some functions in "App_Code" which I call those in index.aspx.cs.

Now, I would like to have a say test.aspx where it outputs XML data, this data is created with a function inside the "SomeClass.cs" in "App_Code". Also, test.aspx also has ( naturally ) a test.aspx.cs.

I only put :

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

inside the test.aspx, the Visual Web Developer gives me an error and sais "<html>" tag is missing ( used too few times ).

The problem is that in my test.aspx.cs I got :

HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "text/xml";
HttpContext.Current.Response.Write("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>");

and then I call some function from the SomeClass.cs etc.

so basically if I add "<html>" into my test.aspx, my XML data won't be valid XML.

Am I doing this wrong or should I just ignore this error about missing "<html>" tag?

:o

Implement a Generic Handler (Add New Item | Generic Handler), which is an implementation of the IHttpHandler interface.

page 1 of 1
Comments: 4 | Views: 871