Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return XML instead of HTML through ASPX?
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
How to return XML instead of HTML through ASPX?
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01134489
Message ID:
01134489
Views:
77
I have a fat client written in VFP which will upload files to an ASPX page on the server which should return an XML string to the client indicating whether files are saved or not.

My problem is that the page returns the HTML page after the XML string as follow:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<VFPData>
<Response>
<Status>
Success
</Status>
</Response>
</VFPData>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
	Untitled Page
</title></head>
<body>
    <form name="form1" method="post" action="Default.aspx" id="form1">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGSQc7Rjvxv7xvLMkvhEIt5BGRUq9w==" />

    <div>
    
    </div>
    </form>
</body>
</html>
I use Response.Write in Page_load event to send the XML to the client, but I don't want the HTML part. If I remove the HTML code from the page source manually, I get the following when I build the website:
"Validation(): Element HTML occurs too few times."
How do I just return the XML? Web Service is not an option since I need to upload files.
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Next
Reply
Map
View

Click here to load this message in the networking platform