473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Response.Write inserting extra

Hello,
I'm creating an .aspx page that gets an XML document (as a string) from a
server via .NET remoting and returns it in the Response.Write method.
I'm saving the document to a file before I return it from the server and it
looks good, well formed and all. But, when I use Explorer to hit the .aspx
page, it returns the document but sticks this in the document some place:
<SN>96620150</SN>
<< The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.
Cannot have a DOCTYPE declaration outside of a prolog. Error processing
resource
'http://localhost/GetSpatialSearch/MySpatialSearch.aspx?layerName=centroid&s
n=98676052&format=xml'. Line 2, Position 11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
----------^
SPAN class="t">SN>96620066</SN>

The above text shows one of the elements (the <SN> element), then the error
text, then another element.

I'm doing a
Response.ContentType = "Text/XML";

prior to writing out to the Response object.
Anybody know how I can get rid of this or is it just and Internet Explorer
thing?

Thanks
Steve
Nov 18 '05 #1
3 1960
On Thu, 8 Jul 2004 15:22:28 -0700, "Steve" <sa****@home.com> wrote:
Hello,
I'm creating an .aspx page that gets an XML document (as a string) from a
server via .NET remoting and returns it in the Response.Write method.
I'm saving the document to a file before I return it from the server and it
looks good, well formed and all. But, when I use Explorer to hit the .aspx
page, it returns the document but sticks this in the document some place:
<SN>96620150</SN>
<< The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.
Cannot have a DOCTYPE declaration outside of a prolog. Error processing
resource
'http://localhost/GetSpatialSearch/MySpatialSearch.aspx?layerName=centroid&s
n=98676052&format=xml'. Line 2, Position 11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
----------^
SPAN class="t">SN>96620066</SN>

The above text shows one of the elements (the <SN> element), then the error
text, then another element.

I'm doing a
Response.ContentType = "Text/XML";

prior to writing out to the Response object.
Anybody know how I can get rid of this or is it just and Internet Explorer
thing?

Thanks
Steve


Sounds like something is getting put into the response stream before
the xml document. Read through the code to find out why there are
elements being output before the actual XML document.

I successfully use this code to output an xml document to the page:

Response.Buffer = true;
Response.ContentType = "text/xml";
xReturn.LoadXml(sXML); // xreturn is an xmldocument.
xReturn.WriteTo(new System.Xml.XmlTextWriter(Response.Output));
Response.Flush();
Response.End();

Also, have you tested the XSL and verified it works?

-Adam
Nov 18 '05 #2

"Steve" <sa****@home.com> wrote in message news:OI**************@TK2MSFTNGP09.phx.gbl...
Hello,
I'm creating an .aspx page that gets an XML document (as a string) from a
server via .NET remoting and returns it in the Response.Write method.
I'm saving the document to a file before I return it from the server and it
looks good, well formed and all. But, when I use Explorer to hit the .aspx
page, it returns the document but sticks this in the document some place:
<SN>96620150</SN>
<< The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.
Cannot have a DOCTYPE declaration outside of a prolog. Error processing
resource
'http://localhost/GetSpatialSearch/MySpatialSearch.aspx?layerName=centroid&s
n=98676052&format=xml'. Line 2, Position 11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
----------^
SPAN class="t">SN>96620066</SN>

The above text shows one of the elements (the <SN> element), then the error
text, then another element.

I'm doing a
Response.ContentType = "Text/XML";

prior to writing out to the Response object.
Anybody know how I can get rid of this or is it just and Internet Explorer
thing?

Thanks
Steve


Did you remove everything (except the <%@ Page %> directive) from the aspx
page? It sound as if that is sent along with the xml document.

The file you write out, does it look good to your eyes, or is it also possible
to open it in IE (use .xml extension)?
What does "View Source" in IE on the (partially) displayed aspx look like?

Hans Kesting
Nov 18 '05 #3
Okay, there was something in the .aspx page. I totally forgot about that. I
just removed everything except the @Page directive and all seems well now.
Thanks very much for your help Hans.

Steve
"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:OJ**************@TK2MSFTNGP11.phx.gbl...

"Steve" <sa****@home.com> wrote in message news:OI**************@TK2MSFTNGP09.phx.gbl...
Hello,
I'm creating an .aspx page that gets an XML document (as a string) from a server via .NET remoting and returns it in the Response.Write method.
I'm saving the document to a file before I return it from the server and it looks good, well formed and all. But, when I use Explorer to hit the ..aspx page, it returns the document but sticks this in the document some place: <SN>96620150</SN>
<< The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
Cannot have a DOCTYPE declaration outside of a prolog. Error processing
resource
'http://localhost/GetSpatialSearch/MySpatialSearch.aspx?layerName=centroid&s n=98676052&format=xml'. Line 2, Position 11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
----------^
SPAN class="t">SN>96620066</SN>

The above text shows one of the elements (the <SN> element), then the error text, then another element.

I'm doing a
Response.ContentType = "Text/XML";

prior to writing out to the Response object.
Anybody know how I can get rid of this or is it just and Internet Explorer thing?

Thanks
Steve


Did you remove everything (except the <%@ Page %> directive) from the aspx
page? It sound as if that is sent along with the xml document.

The file you write out, does it look good to your eyes, or is it also

possible to open it in IE (use .xml extension)?
What does "View Source" in IE on the (partially) displayed aspx look like?

Hans Kesting

Nov 18 '05 #4

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

Similar topics

0
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
9
by: Ricardo | last post by:
Hi. How should I pass a " (doble-quote) character to response.write() in order for it to be sent to the output ? Thanks in advance for the help.
35
by: Eitan | last post by:
Hello, How can I write a line (with carriage return + line feed) to the client ? response.write("abcd"), continue the last line, and doesn't put cr+lf. response.writeLn is illegal syntax... ...
7
by: Steven Blair | last post by:
Hi, I am using C# and IIS for a application. I receive a request message, process it then send a response back to my client. The problem I have, when I call Response.Write the message sent to my...
2
by: Sam Miller | last post by:
I have a submit button. In the event handler for that button I connect to database and write all the control values to the db. Then I have a response.redirect after the Conn.Close to leave the...
2
by: David Union | last post by:
Hi. I'm posting this here because I don't know exactly what the best group is. This is for an aspx page with Visual Basic as the code-behind page. I am doing very simple code... in the middle...
4
by: Dorte | last post by:
Hi, I am using the code below to stream a CSV file with the response object. Dim FileName As String = "Test.csv" With Web.HttpContext.Current.Response ...
22
by: EMW | last post by:
Hi, When I use Response.Write "something" it is placed at the top op de html document above the <HTML> tag. I need it to be put in the BODY part. How can I do this? rg,
7
by: eventuranza | last post by:
For my application, there users can upload and download files to the a webserver. Straightforward enough. However, when they upload a PDF file then try to download it, the file seems to be...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.