WebRef.eu  - Internet Marketing and Online Business Resources

Home | Contact Us

Google
 

Coding A Page Dependence in ASP Classic

If you need some ASP code to execute only on a given page, the way to do this is with a statement like:

<%
If InStr(Request.ServerVariables("SCRIPT_NAME"), "yourpagename.asp") = 0 Then
%>

where you should substitute "yourpagename.asp" with the actual name of your .asp page.

The InStr function returns the position of a given string (in this case "yourpagename.asp") within another (in this case Request.ServerVariables("SCRIPT_NAME")). InStr will return 0 when each string is exactly the same.

An example usage of this is to highlight the page name when you are on that page, by substituting a particular image only on that page.

 



Join Top Affiliate Networks Join Top Affiliate Networks >>>



Paid On Results








Home | Contact Us

All Content ©2006 WebRef.eu