views:

206

answers:

1

Hey there, I am traversing all the links in my own code base, and changing them from <a href="x"> to <asp:HyperLink>'s for localization reasons. I'm using the HTMLAgilityPack for this (and other things) and I'd like to just change the OuterHtml object for the links I find..but it's read-only?

I'm new to the HAP, do I need to create a new node and delete the old one? Has anyone run into this?

Thanks!

A: 

I ended up using...

node.ParentNode.ReplaceChild(HtmlNode.CreateNode(HrefToAspLinkText(node.OuterHtml)), node)

hmm. worked, but ugly.