我有一個包含文件的包含文件,該文件包含該網站的主導航菜單。我希望能夠爲當前頁面設置一個CSS類。這是我已經能夠到目前爲止放在一起:在ASP Classic中爲導航菜單設置CSS類爲「當前」
public function GetFileName()
Dim files, url, segments, current
'get then current url from the server variables
url = Request.ServerVariables("path_info")
segments = split(url,"/")
'read the last segment
url = segments(ubound(segments))
GetFileName = url
end function
if GetFileName = "index.asp" then
current = "current"
else
current = ""
end if
我在想,Select Case語句會在這種情況下使用的東西,我只是不知道如何去構建它?提前致謝!
菜單究竟如何大,我們談論的?如果你只談論幾件物品,一些選擇就沒有問題,但是如果有很多物品需要檢查,會有點麻煩。 – AnonJr