嗨,我完全迷路了,我有一个使用用户安全级别自行创建的菜单
但是我不知道如何显示子菜单我的桌子上有一个 parentid 但不知道如何在代码中实现有人可以帮助我输入我的模板代码
Dim CurrentSecLev 'security level of the requested menu item
Dim MenuLink 'filename or url of the menu item
Dim MenuText 'display text of the menu item
'build sql query string, open database, and execute the query
strSQL = "SELECT * FROM dbo.tblMenus where mnuParentID = 0 ORDER BY mnuOrder"
objConn.Open
set objResults=objConn.Execute(strsql)
'loop through the records and build the menu
do while not objResults.eof
CurrentSecLev=objResults("mnuSecLev")
MenuLink=objResults("mnuLink")
MenuText=objResults("mnuText")
'check to ensure that the users security level meets or exceeds the required
'security level of the current menu item. This ensures that only authorized
'users see certain menu items, such as 'Site Admin'.
if MySecLev => CurrentSecLev then
response.write "<li><a href='" & MenuLink & "'>" & MenuText & "</a></li>" & vbcrlf
end if
'rock on
objResults.Movenext
Loop
'close and destroy the recordset, close the database.
objResults.Close
set objResults=Nothing
objConn.Close
'check to see if the user is logged in. if they are, display the logout
'option. if they are not logged in, display the login option.
If LoggedIn="Yes" Then
response.write "<li><a href='logout.asp'>Logout</a></li>" & vbcrlf
Else
response.write "<li><a href='login.asp'>Login</a></li>" & vbcrlf
End if
%></ul><Form Action="searchresults.asp" method=post id=form3 name=form3><p><input name="searchquery" id="searchquery" size="10"/><input name="Submit" id="Submit" type="submit" value="Search!" /></p></form>
<p> </p>
<%
Dim rsArray
Dim rs
objConn.Open
strSQL = "SELECT * FROM tblKBMain where title <> '' or [content] <> ''"
Set rs = objconn.execute(strSQL)
if not rs.eof then
rsArray = rs.GetRows()
nr = UBound(rsArray, 2) + 1
Response.write "<p>" & nr & " articles</p>"
end if
rs.close
set rs = nothing
objConn.Close
%>
</div>