There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
OptionOutputOriginalCase is ignored for attributes when not outputting XML
I've been using Html Agility Pack to automatically modify some HTML forms and insert ASP.NET tags into them. I ran into a problem whereby I could specify attributes with names such as "AssociatedControlID", but they would always be output as "associatedcontrolid", even when OptionOutputOriginalCase was set to true. I had a look in the source for the library and the problem appears to be in HtmlNode.WriteAttribute. The check for OptionOutputOriginalCase = true is only carried out if OptionOutputAsXml is also true. I think this option should be checked in either case, and if it is true, the original attribute name used. Unfortunately, I can't switch on XML output, as this causes problems with ASP.NET tag names like "asp:TextBox", so I'm using a modified version of the library to get around the problem for now.