Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6753947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:13:19+00:00 2026-05-26T13:13:19+00:00

Is there a way to upload an xml in c# and map the values

  • 0

Is there a way to upload an xml in c# and map the values to certain textboxes using jquery?

<?xml version="1.0" encoding="ISO-8859-1"?>
<AuditSheet>
<CustomerInfo>
<CustomerName></CustomerName>
<PlantSiteName></PlantSiteName>
<SystemName></SystemName>
<PhysicalAddress1></PhysicalAddress1>
<PhysicalAddress2></PhysicalAddress2>
</CustomerInfo>
</AuditSheet>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:13:20+00:00Added an answer on May 26, 2026 at 1:13 pm

    youve asked a complex question with very little description of what it is exactly you want to achieve.

    What I think you want to do is allow a user to upload an XML file to a webpage and then i guess using AJAX send the XML to the server and have it return JSON so you can use that to populate fields on that same page.

    What you can do is create a HTTP handler (implementing IHttpHandler). Register that handler in your web.config with a specific URLfor example /services/sheetuploader.ashx.

    Then define a class called AuditSheet and CustomerInfo and decorate them with a DataContract attribute and mark the members matching your AuditSheet XML elements with DataMember attributes.

    Something like:

    [DataContract]
    public class AuditSheet
    {
       [DataMember]
       public CustomerInfo CustomerInfo{get; set;}
    }
    
    [DataContract]
    public class CustomerInfo
    {
       [DataMember]
       public string CustomerName {get;set;}
    
       //rest of the members go here...
    }
    

    You can then use the System.Runtime.Serialization.DataContractSerializer object to read the XML into an instance of your AuditSheet class. See the ReadObject method for doing that. You do this in the ProcessRequest method of your Http Handler.

    After creating the object you can then serialize to JSON by using System.Runtime.Serialization.Json.DataContractJsonSerializer and its WriteObject method.

    To send back JSON to the client you add the following to the ProcessRequest method

    context.Response.ContentType = "text/json";
    context.Response.Write(ConvertToJson(auditSheet)); //auditSheet is an instance of AuditSheet read from XML
    

    to send the XML to the server you can use jQuery’s AJAX method using a POST request.

    Hope im close to what youre actually trying to do and that this can help you get started.

    Yoav.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to upload an entire folder using PHP?
Is there a way to upload a file, save it to a Stream, this
Is there a way I can upload a file to my web server to
Is there a simple way to upload a single file through HTML input type
Hey I was wondering if there were any way to upload images in ASP?
I wanted to knw if there is way we can upload /download a blob;
Is there some way to validate the image size (height and width) before upload
Is there a way to kill the unload function with javascript(jquery)? I am looking
We need to upload the attachments(for ex. word document) in xml file. Is there
I'm looking for a simple way to upload a file (an xml file) to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.