In a recent post, I introduced graspx, a tool to check aspx source code files.
Let me show you some usages of this tool (usage requires that you cd to your web development directory):
Check XML compliance
Find all aspx files that are not XML-compliant:
graspx c -ce
Display all ascx files that are not XML-compliant
graspx c -ce *.ascx
Check page titles
To find all aspx files with no set page title, run
graspx l Title | find "Untitled Page"
Check EmptyDataText
If you copy and paste practice code reuse often, you may sometimes overlook changes in texts in the GUI which are not always displayed, such as GridView.EmptyDataText.
To retrieve list of all messages in EmptyDataText, run
graspx l EmptyDataText
To reduce the output to relevant information, namely filename plus text, add the for command (type “help for” for explanation):
for /f "usebackq delims=: tokens=1,5" %i in (`graspx l EmptyDataText`) do @echo %i: %j
Check CSS references
These procedures are useful if you want to clean up your CSS definitions:
Find all elements with inline styles:
graspx l style
Find all CSS styles referenced by your ASP.Net files:
graspx l class graspx l CssClass graspx l class *.master graspx | CssClass *.master graspx l class *.ascx graspx | CssClass *.ascx
Get sorted results:
(for /f "usebackq delims=: tokens=5" %i in (`graspx l CssClass`) do @echo %i) | sort
Unfortunately, Windows sort lacks functionality to return unique results.
To be continued…
Pingback: Checking ASP.Net Source Code with graspx, part 2 « devioblog
Pingback: Building Visual Studio Solutions from the Command Line « devioblog