http://www.webmasterworld.com Welcome to WebmasterWorld Guest from 38.103.63.18
register, login, search, glossary, subscribe, help, library, PubCon, announcements , recent posts, unanswered posts
PubCon Exhibitor
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library : Charter : Moderator: open

Microsoft IIS Web Server and ASP.NET

  
ASP Help Please.
chame


#:3635346
 7:38 pm on April 25, 2008 (utc 0)

I haven’t a clue if what I am trying to do is displayed correctly in my code below. What I ultimately would like to do is: when all of the data is pulled from the database (they are stored in the same column but some of the entries are on different levels) example:

Column entries: & Levels
Airline 1
Delta 2
Passengers 3
Baggage 4

What I would like to do is when this information is displayed on my website each level has to descend properly such as this when called from the database:

Airline
___Delta
___ Passengers
_____Baggage

Here is the code that I have so far: The bold section is what I am having the most problems with I’m not even sure if I am writing the code properly? What I want it to do is call all the data display the first item (“airline“) then save it & call the next item (“delta”) compare it to the first item, if the level numbers are different then save it under the first item (“airline”) etc… Does this make sense? I’m not sure where to start…. Any help would be sooo greatly appreciated. Thanks in Advance!

<%

'get Recordset, objRS
dim objRS
set objRS = server.CreateObject("adodb.recordset")

dim y
if request("goCat") = "Go" and request("txtSearchCategory") <> "" then
y = FindLUCategoriesByName( request("txtSearchCategory"),(request("selDoc")), objRS)
elseif request("showCat") <> "" then
y = GetLUCategories("", objRS)
elseif request ("selDoc")<> "" then
y = GetLUCategoriesByLayer(objrs, request ("selDoc"), 2)
else
y = GetLUCategories("", objRS)
end if

if objRS.eof then
if request ("selDoc")<> "" then
y = GetLUCategoriesByLayer (objrs, request ("selDoc"), 2)
if layer >= 1 then
objRS.MoveNext
else
end if

Do While Not objRS.EOF

category = objrs("CATEGORY_NAME")
layer = objrs("LAYER_NUMBER")
documentTypeId = objrs("DOCUMENT_TYPE_ID")
categoryId = objrs("CATEGORY_ID")
parentCategoryId = objrs("PARENT_CATEGORY_ID")


dim counter
counter = 0
loopCounter = loopCounter + 1

'Now loop through the recordset Fields
For Each objField in objRS.Fields
counter = counter + 1
temp = objField.value

if objField.name = "CATEGORY_ID" then

elseif objField.name = "CATEGORY_NAME" then
if IsNull(objField.value) then
temp = "&nbsp;"

end if
'First, display the TABLE header info:
Response.Write "<Table border=1 cellspacing=0 cellpadding=5 id=box>"
'Write the TR
Response.Write "<TR>"
Response.Write "<TD>"
Response.Write "<ul>"
Response.Write "<a href=category.asp?edit=categoryId" & ">" & Category & "</a>"
Response.Write "<ul>"
Response.Write "<li>" & Category & "</li>"
Response.Write "</ul>"
Response.Write "</ul>"
Response.Write "</TD>"


Response.Write "<TD>" & "</TD>"

'Close the TR tag
Response.Write "</TR>"
'Close the table tag...
Response.Write "</TABLE>"
end if
Next
'Advance the recordset
objRS.MoveNext
Loop
end if

objRS.close
set objRS = nothing
end if
%>

 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of WebmasterWorld Inc.
© WebmasterWorld Inc. / SearchEngineWorld 1996-2008 all rights reserved