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 small command-line tool to check and search any 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 alway strict XML.
graspx c *.aspx
graspx c *.ascx
graspx c *.masterpage
As all files are verified, you can
- search for text occurrences in attribute values
- list the values of a specific attribute
For further information, see the following blog posts:
- Introducing graspx
- Check ASP.Net Source Code with graspx
- Check ASP.Net Source Code with graspx (part 2)
- Analyzing ASP.Net Source Code with graspx
- Analyze User Control usage and Hyperlinks
- Checking NavigateUrls in ASP.Net
- Extended Functionality in graspx (0.14)
- Updating graspx (0.15)
- Finding SELECT Commands in .aspx Files
- Support for ASPX comments