473,396 Members | 1,998 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,396 software developers and data experts.

I try to send an xml from an aspx pages which generate an xml file. And I tried with this method

Hello,

I try to send an xml from an aspx pages which generate an xml file.
And I tried with this method
FileStream fs = new
FileStream(WebSdxResponse.file_path,FileMode.Open, FileAccess.Read,FileSh
are.None);
byte[] b = ReadFully(fs,(int) fs.Length);Response.Clear();
Response.ContentType= “text/xml”;
Response.AppendHeader("content-disposition","attachement;filename=test.x
ml");
Response.OutputStream.Write(b,0,b.Length);
Response.End();
Response.Close();
Orig: xml format, I sure the xml format is well formatted.

In my Internet explorer, I have some extra characters (_ViewState, html
tags…). But when I change the ContentType(“blabla/bXml”) and change
filename to test.Dxml. It works well.
Could help me to send an xml page well formatted in internet explorer?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 1444
zoltix wrote:
Hello,

I try to send an xml from an aspx pages which generate an xml file.
And I tried with this method
FileStream fs = new
FileStream(WebSdxResponse.file_path,FileMode.Open, FileAccess.Read,FileSh
are.None);
byte[] b = ReadFully(fs,(int) fs.Length);Response.Clear();
Response.ContentType= "text/xml";
Response.AppendHeader("content-disposition","attachement;filename=test.x
ml");
Response.OutputStream.Write(b,0,b.Length);
Response.End();
Response.Close();
Orig: xml format, I sure the xml format is well formatted.

In my Internet explorer, I have some extra characters (_ViewState,
html tags.). But when I change the ContentType("blabla/bXml") and
change filename to test.Dxml. It works well.
Could help me to send an xml page well formatted in internet explorer?


You are sending this from the codebehind of an aspx page?
Did you clear all html code out of that aspx file?

By the way, the content-disposition is "attachment", in your post you
add en extra "e" in the middle (might be a typo in the post)

Hans Kesting
Nov 16 '05 #2


zoltix wrote:
Hello,

I try to send an xml from an aspx pages which generate an >xml file.
And I tried with this method
FileStream fs = new

FileStream(WebSdxResponse.file_path,FileMode.Open ,FileAccess.Read,FileS h are.None);
byte[] b = ReadFully(fs,(int) fs.Length);Response.Clear();
Response.ContentType= "text/xml";

Response.AppendHeader("content-disposition","attachement;filename=test. x ml");
Response.OutputStream.Write(b,0,b.Length);
Response.End();
Response.Close();
Orig: xml format, I sure the xml format is well formatted.

In my Internet explorer, I have some extra characters >(_ViewState,
html tags.). But when I change the >ContentType("blabla/bXml") and
change filename to test.Dxml. It works well.
Could help me to send an xml page well formatted in >internet explorer?
You are sending this from the codebehind of an aspx page?
Did you clear all html code out of that aspx file? By the way, the content-disposition is "attachment", in >your post you
add en extra "e" in the middle (might be a typo in the >post) Hans Kesting



In fact, it is a button on my Aspx page which generates a stream. This
issue is only with the xml format. For a others format, they work well
(Exe,Zip….). I am going to try to add an aspx page just for the
downloading and I hope that I will resolve my problem
But I don’t understand why with the xml formats(Ext(.xml) or
Type(Text/Xml)) only, it don’t work?

Thank a lot


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

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

Similar topics

4
by: Mark J. McGinty | last post by:
Greets, Part of the content of one of our web pages uses wingdings and Chr(239) through Chr(242) (which are little arrow outlines, though that's not really important.) It worked just fine in...
11
by: ajikoe | last post by:
Hello, I used Visual C# Standard Edition. I want to comment my program using xml commentary method, I don't know why if I use value and example tag, it is not working / showed in the html...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
4
by: orianavim | last post by:
Hi, I'm try to find an easy efficient way to generate my web pages dynamically from an xml/text file. What exactly I want? I want that whenever a pages is loaded it will go and read an...
0
by: David Hauser | last post by:
Hi all I have a aspx page that should generate a zip file from a couple of files. I tried the following code, but something doesn't work correctly, although no error message appears and the...
2
by: JB | last post by:
I have existing aspx pages that I'm editing in VS 2005 that I add a server control to - like a label. I include the runat="server" and it doesn't seem to create the reference in the code behind for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.