Return to Snippet

Revision: 6718
at June 10, 2008 21:34 by neal_grosskopf


Initial Code
function CreatePageClassName()

	url = lcase(request.ServerVariables("URL"))
	url = right(url,len(url)-1)	
	url = replace(url,"/","_")
	url = replace(url,".asp","")
	
	CreatePageClassName = "url_" & url

end function

Initial URL
http://www.nealgrosskopf.com/tech/thread.asp?pid=15

Initial Description
Use this function to create a unique class name based on the page's url. It makes for a great way to drill down with specificity in CSS later by placing this on the ID or as a Class on the body tag.

Initial Title
Create Class Name From URL In ASP

Initial Tags
css, ASP

Initial Language
ASP