473,398 Members | 2,404 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,398 software developers and data experts.

XhtmlTextWriter Issue: cant write to page

I am fairly new to ASP and wanted to output certain parts of an xml
file directly to the page, I tried the following method however it did
not work, any help in correcting this issue would be greatly
appreciated

AppSettings As = new AppSettings();
XmlTextReader reader = new XmlTextReader(As.Loca + "./pages/" +
PageID.ToString() + "/page.xml");
XhtmlTextWriter writer = new XhtmlTextWriter(TextWriter.Null);
while (reader.Read())
{
if (reader.Name == "Name")
{
string x = reader.ReadString();
writer.WriteLine(reader.ReadString());
}
}
writer.Close();

this in my mind would print the page's name to the page, however it
does not work correctly, when debugging at
writer.WriteLine(reader.ReadString()); I can tell all variavles hold
the correct values therefore that is not an issue. Thankyou for your
help.

Nov 19 '06 #1
2 1840
Wouldn't the lines

string x = reader.ReadString();
writer.WriteLine(reader.ReadString());

be

string x = reader.ReadString();
writer.WriteLine(x);

as otherwise it kind of reads "over" the name.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"TheReckter" <Th********@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
>I am fairly new to ASP and wanted to output certain parts of an xml
file directly to the page, I tried the following method however it did
not work, any help in correcting this issue would be greatly
appreciated

AppSettings As = new AppSettings();
XmlTextReader reader = new XmlTextReader(As.Loca + "./pages/" +
PageID.ToString() + "/page.xml");
XhtmlTextWriter writer = new XhtmlTextWriter(TextWriter.Null);
while (reader.Read())
{
if (reader.Name == "Name")
{
string x = reader.ReadString();
writer.WriteLine(reader.ReadString());
}
}
writer.Close();

this in my mind would print the page's name to the page, however it
does not work correctly, when debugging at
writer.WriteLine(reader.ReadString()); I can tell all variavles hold
the correct values therefore that is not an issue. Thankyou for your
help.

Nov 19 '06 #2
That did not seem to work for me either, do you have any other
suggestions?

Nov 19 '06 #3

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

Similar topics

4
by: Jake Lewis | last post by:
I have an HTML page that loads fine including the .js file <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script...
7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
3
by: pyda001 | last post by:
Hi! We are working on a webshop issue and are facing the following problem. Chances are that this has been solved before and thus we don't need to reinvent the wheel. Our website is supposed...
2
by: JJ | last post by:
Hi, I am using a frameset in an aspx page, like so: <Frameset id="Frameset" BORDER="0" ROWS="350,3%" HEIGHT="100%" FRAMEBORDER="0" FRAMESPACING="0" runat="server">
4
by: Paul | last post by:
Hi, I've been struggling with this today, I'm developing a DotNet2.0 website in C# that needs to call a long running data query. Obviously this is a good candidate for an Asynchronous call, so...
2
by: Sean | last post by:
We have a Master page problem that comes around time and time at work and it’s a problem that has been confirmed by other developers on the project I have been on. Additionally I have had the...
1
by: Simon Gare | last post by:
Hi, I cant seem to alter the text size on the code below only the colour, the code you see is all that the page consists of from start to finish that's all of it, cant apply css nothing works. ...
0
by: =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post by:
Hi all, I am building a Composite control, and I need to render Xhtml content for my control. Here is my sample code: protected override void Render(HtmlTextWriter output) { XhtmlTextWriter...
3
by: satyabhaskar | last post by:
Actuall im designing my web page, in that i have text box with name book number ...what i require is if the user will type a new number which is not in the data base and press enter then i want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.