XmlRoot() for Xml Serilization does not work

前端 未结 3 2081
旧时难觅i
旧时难觅i 2020-12-18 22:58

I\'m trying to get my httphandler to print out an XML file with the format:


    ...         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 23:10

    I found an answer to my question here:

    http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/4b228734-a209-445a-991c-0420b381ac93

    I just used [XmlType("")] and that worked.

    using System;
    using System.Xml.Serialization;
    
    
    namespace CommunityServer.Scheduler
    {
    
        [XmlType("ScheduledShowElement")]
        public class ScheduledShow
        {
    
          ...
        }
    }
    

提交回复
热议问题