arrPath = Split(Request.ServerVariables("SCRIPT_NAME"), "/")
strfileName = arrPath(UBound(arrPath))
if strfileName = "test.asp"thenresponse.write"You are editing the test page."elseif strfileName = "default.asp"thenresponse.write"You are loading the live page."end if
The above is just an example. To use this in a real-world scenario, we will do something like this. Here, we are changing the file name in our live code from test.asp page to the default.asp page. This way, we can run our test on the test page, then move our code to the live page and test it there.
if strfileName = "test.asp"then
theFile = "test.asp"elseif strfileName = "default.asp"then
theFile = "default.asp"end if
Siteurl = "192.168.2.1/MySite"
theSiteID = "//"&Siteurl&"/"&theFile&"?Type=Site&ID=1
When you load the test.asp page. This will trigger the code to load the appropriate file name in the page links. This will enable you to click links throughout the site without worrying about the page loading the default.asp page.
Scenarios like this are what we use in our development. Though we have not used this method before, we have started doing it to make it easier to develop our site when working with the rewrite rules.