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

How can i get content from xml file in a string format?

How can i get content from xml file in a string format?

I have an xml file. Within the xml file is html code.
I want to do:

string webpage = !! somehow read xmlfile as a string
Response.Write(webpage);

what do i need in order to do this?

thanks
Nov 17 '05 #1
2 1508
stringy wrote:
How can i get content from xml file in a string format?

I have an xml file. Within the xml file is html code.
I want to do:

string webpage = !! somehow read xmlfile as a string
Response.Write(webpage);

what do i need in order to do this?

thanks


If you just want to "response.write" the entire file, there is also
Response.WriteFile(filename);
Hans Kesting
Nov 17 '05 #2
In message <00****************************@phx.gbl>, stringy
<an*******@discussions.microsoft.com> writes
How can i get content from xml file in a string format?

I have an xml file. Within the xml file is html code.
I want to do:

string webpage = !! somehow read xmlfile as a string
Response.Write(webpage);


protected override void Render(HtmlTextWriter writer)
{
string file = Server.MapPath("file.xml");
using (System.IO.StreamReader sr = new System.IO.StreamReader(file,
System.Text.Encoding.Default,false))
{
writer.Write(sr.ReadToEnd());
}
}

--
Steve Walker
Nov 17 '05 #3

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

Similar topics

1
by: Franck | last post by:
Hello, I'm trying to diplay the content of a word file on a aspx page only the content if possible... not the file I tried the folowing but it doesn't work... Response.ContentType =...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
5
by: Davo1977 | last post by:
Analysing text files to obtain statistics on their content You are to write a Perl program that analyses text files to obtain statistics on their content. The program should operate as follows: ...
3
by: madankarmukta | last post by:
Hi, Objectives is to write the DataTable content to the text file in the format Col1 | Col2 | Col3 ------|-------|--------- Val11 | Val21 | Val31 Val12 | Val22 | Val32 Val13 | Val23 |...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.