I can't seem to find the appropriate help page for this simple problem.
I have a web page, e.g.
http://people-places-work.info/showCelebrities.aspx
and create the xml (by hitting the "Export as XML" )
but want to display that page, rather than store it on my HD.
Does anyone know how that should be done?
I have tried just
Response.Write(xmlPPW);
which is a bit better, although my xml tags are not showing up.
Should I save a temp file and then redirect to it?
Right now, the source code is
------------showCelebrities.aspx ----------
.......
<asp:FileUpload ID="FileUploadXml" runat="server" ToolTip="select filename
to download" />
<asp:Button ID="ButtonExportXML" runat="server"
OnClick="ButtonExportXML_Click" Text="Export as XML"
ToolTip="To PDA app" />
<asp:Label id="LabelXml" runat="server" />
.....
-------------eof
------------showCelebrities.aspx.cs ----------
protected void ButtonExportXML_Click(object sender, EventArgs e)
{
int irc = 0;
String outStr = "";
try
{
// export data to xml file on user's local disk
String xmlPPW = dtCelebrities.DataSet.GetXml().Normalize();
if (FileUploadXml.HasFile)
{
//Uncomment this line to Save the uploaded file
String stFileWPath = FileUploadXml.FileName;
//FileUploadXml.SaveAs("C:\\"+ stFileWPath);
//Response.OutputStream.Read( xmlPPW);
LabelXml.Text = "Saved " + FileUploadXml.FileName + " Content Type " +
FileUploadXml.PostedFile.ContentType + " Length " +
FileUploadXml.PostedFile.ContentLength;
Response.Write(xmlPPW);
}
else
{
LabelXml.Text = "No uploaded file";
}
}
catch (Exception ex)
{
irc = -9934;
outStr += ("showCelebrities::ButtonExportXML_Click<br />Exception ex=" +
ex.Message + "<br />");
Response.AppendToLog(outStr);
}
}
.....
-------------eof