473,473 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

asp.net 2.0 - aspx file to return xml?

Hi. The question may be stupid, but when I try ti produce asp file that
outputs xml the way I did it in 1.1 - by emptying the aspx file itself
or adding something like
<?xml version="1.0" encoding="utf-8" ?>
<test><%=phrase%></test>
in there, I get XHTML validation errors and my web site refuses to
build.

How do I fix this?

Jun 18 '06 #1
4 1221
Do you use web application project or something that forces you to build
"for real" in VS2005? See, with default web site model, "Build" you do in VS
is actually just a deep validation check (it also notes XHTML validation
errors), which yes errors in VS, but it doesn't prevent you from running the
page at all ASP.NEt environment is the one doing the compilation, VS doesn't
actually do it. (VS2005 Web Application project, WAP, is a different beast
as it works similarly as things worked in VS2003).

Just open the page in browser from the server.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Sergei Shelukhin" <re******@gmail.com> wrote in message
news:11*********************@c74g2000cwc.googlegro ups.com...
Hi. The question may be stupid, but when I try ti produce asp file that
outputs xml the way I did it in 1.1 - by emptying the aspx file itself
or adding something like
<?xml version="1.0" encoding="utf-8" ?>
<test><%=phrase%></test>
in there, I get XHTML validation errors and my web site refuses to
build.

How do I fix this?

Jun 18 '06 #2
I did, it says BC30451: Name 'phrase' is not declared., as if the page
wasn't built (phrase is defined as public string and the value is set)

Jun 18 '06 #3
I would try emptying the ASPX page portion of everything except the @Page
declaration.

Then in your Page_Load in your codebehind,
Response.ContentType="text/xml";
Response.Write (your xml string here);

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Sergei Shelukhin" wrote:
Hi. The question may be stupid, but when I try ti produce asp file that
outputs xml the way I did it in 1.1 - by emptying the aspx file itself
or adding something like
<?xml version="1.0" encoding="utf-8" ?>
<test><%=phrase%></test>
in there, I get XHTML validation errors and my web site refuses to
build.

How do I fix this?

Jun 18 '06 #4
Oh. It was actually the @Page declaration that i accidently removed
that was causing the errors; it works now

Thanks :)

Jun 19 '06 #5

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

Similar topics

11
by: tma | last post by:
I have the following HTML in use on my web page. I need it to show a graphic image on the page but do not know what to use in the codebehind to make the graphic appear. If I load the source url in...
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...
5
by: c676228 | last post by:
Hi, I guess I am confused. In aspx script, I mean (you won't use Codebehind="enrollinfo.aspx.vb", but mix code with html and code together) You can access user control's property directly. Since I...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.