Every web developer needs to search source code every now and then. Tools like find, grep, or an IDE’s “Find” function can only search full text, without regard to context.
Since ASP.Net files (aspx, ascx) are XML-based, and should therefore be XML-compliant, an XML-aware tool searches more efficiently.
Enter graspx (grep for aspx), a command-line tool to check and search any XHTML/XML-based files created in Visual Studio 2005.
As a first step, use graspx to check whether your files are XML-compliant. Unfortunately, files created with Visual Studio are not always strict XML, although VS2005 tends to be more compliant than VS2003.
graspx c *.aspx graspx c *.ascx graspx c *.masterpage
graspx will report if files are not XML-compliant (missing closing tags, missing quotes for attribute values).
As all files are verified, you can
- search for text occurrences in attribute values
- list the values of a specific attribute
Invoking graspx without parameters will display the help text with all available commands and switches.