ASP.NET / ASPX: "Unexpected duplicate node name for HTML cache"
Looked through your log-file to find out why scanning is giving me a hard time in aspx files. I'm not sure I found my issue, but I found another one + a solution.
Please look at this code snippet:
The Error I'm getting is something like:
11:21:48.280858: Unexpected duplicate node name for HTML cache Test.aspx.Literal1.Text
And basically the error occurs because of the usage of "GridView" (could have been ListView or other similar controls). Basically I would recommend you reconsider your "cache naming".
As is, it would try to insert 3 items into the cache:
3 items with the same name, giving duplicate name error.
ASPX Control ClientID
This is actually a situation handled by ASPX already. Every control has a "ClientID" (as well as ID). "ClientID" will kind of contain the ParentID's, but not in all parent IDs. It depends if the control is having it's own scope or not - not sure how this is determined, when I look at PlaceHolder, this does not have it's own scope, but GridView does.
In my example it could be 3 ID's like
If you are not able to use "ClientID" (or prefer not to), you could consider some way to find out if a ParentID defines a new scope or not, so e.g. GridView name becomes part of your name like:
Not sure how to do this. There might be an Attribute (PersistenceModeAttribute (PersistenceMode enum) on GridViewColumns?) in relation to the GridView that could tell this, maybe it's the ITemplate type or similar..
This could explain some issue I've had in the past (since auto-generated ID's can cause some nasty issues).