This project has moved and is read-only. For the latest updates, please go here.

HtmlNode.OuterHtml does not keep Name Case

Topics: Developer Forum
May 6, 2010 at 2:24 PM

I am using Html Library Pack to modify existing ASP code adding custom attributes.

My concern is that I am not able to keep the original case while going through my transformation process.

Let's take a small example:

string sampleAspCode = "<asp:Image ID="Image3" runat="server" />";

HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.OptionOutputOriginalCase = true;
htmlDoc.OptionWriteEmptyNodes = true;

HtmlNode node;


If I set a breakpoint to have node equals to my "asp:Image", I can see the following in local pane:

node.Name = "asp:image";
node.OriginalName = "asp:Image"
node.OuterHtml = "<asp:image id=\"Image3\" runat=\"server\"></asp:image>"

Having htmlDoc.OptionOutputOriginalCase true, I was expecting to keep the original case in nodeOuterHtml. This is not the case.

Am I doing something wrong ?