Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi members, I need some help here.

I have created the wpf form and it populates the xml document. I have created the web form but i don't know how to go about what the question is asking.

someone help the code of creating a button and that uploads the xml created and display its content in table form.

Displaying the content of the uploaded xml in table form or rather in a nice way is what i need.

What I have tried:

Here is the code in the form for button and textbox.

<form id="form1" runat="server">
    <asp:FileUpload id="FileUploadControl" runat="server" />
    <asp:Button runat="server" id="UploadButton" text="Upload" onclick="UploadButton_Click" />
    <br /><br />
    <asp:Label runat="server" id="StatusLabel" text="Upload status: " />
</form>
--------
And here is the code required to handle the upload..

<pre>protected void UploadButton_Click(object sender, EventArgs e)
{
    if(FileUploadControl.HasFile)
    {
        try
        {
            string filename = Path.GetFileName(FileUploadControl.FileName);
            FileUploadControl.SaveAs(Server.MapPath("~/") + filename);
            StatusLabel.Text = "Upload status: File uploaded!";
        }
        catch(Exception ex)
        {
            StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
        }
    }
}
Posted
Updated 10-Jun-18 5:33am

1 solution

XML is already in "human readable" form.

In order to display it "nicely", you can simply output it as a "string"; with a line break after each ending tag.

Anything else, and it gets "complicated".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900