Posted By

neal_grosskopf on 06/10/08


Tagged

css ASP


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

neal_grosskopf
asifrizvigmailcom


Create Class Name From URL In ASP


 / Published in: ASP
 

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

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.

  1. function CreatePageClassName()
  2.  
  3. url = lcase(request.ServerVariables("URL"))
  4. url = right(url,len(url)-1)
  5. url = replace(url,"/","_")
  6. url = replace(url,".asp","")
  7.  
  8. CreatePageClassName = "url_" & url
  9.  
  10. end function

Report this snippet  

You need to login to post a comment.