| There a dozens of examples of how to create client side drop down menus in JavaScript. At EggHeadCafe.com, we really needed a simpler version that we could generate from server side ASP code. The code example you see below could easily be modified to pull the menu items out of a database file or XML. Since our values are fairly static, we hard coded the array values. | | Feel free to take the code and modify it to fit your needs... | | |
|
| "
WriteTopMenuDropDown sURL,1
WriteTopMenuDropDown sURL,2
WriteTopMenuDropDown sURL,3
WriteTopMenuDropDown sURL,4
RW vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf
End Sub
Sub WriteTopMenuList(sListName,nListNum,sArray,nTot)
Dim nCnt
RWJS ""
End Sub
Sub RW(sVal)
Response.Write sVal & vbcrlf
End Sub
Sub RWJS(sVal)
Response.Write sVal
End Sub
Sub WriteTopMenuJS()
RWJS ""
End Sub
' Test page code begins here...You may take this out for your pages...
RW ""
RW " "
RW ""
RW " "
RW "| "
WriteTopMenuJS
WriteTopMenu 1
RW " | "
RW " "
RW ""
RW ""
%>
|
|
|
|  | Robbe has been a Microsoft MVP in C# since 2004. He is also the co-founder of EggHeadCafe which provides .NET articles, book reviews, software reviews, and software download and purchase advice. |
|