Wednesday, May 2, 2012

How to find unused controls registration in ASP.NET

In order to find unused controls registration this regular expression might be helpfull

<%@\s*Register\s+TagPrefix\s*=\s*"(?<tagprefix>[^"]+)"\s+TagName\s*=\s*"(?<tagname>[^"]+)"\s+Src\s*=\s*"[^"]+"\s*%>(?!.*?\k<tagprefix>:\k<tagname>\s+)

I used powergrep to run this regex. The "Dot matches newline" checkbox should be enabled to work properly.

No comments:

Post a Comment