Ok I have a menu setup that I did in asp and need to convert it to asp.net. I read the data from the database an looped through it to build the menu. This ius how the data is structured.
Seq_no Search_level name
--------- --------------- -------
100 1 Status
120 1 Area
140 2 By County
160 2 By Town
180 2 Exclude Town
200 2 By State
220 2 Area Number (separate by , )
240 2 Village/Project
260 2 Zip Code(s)
280 2 Street Name(s)
300 2 Street Number
320 1 Price Range
340 2 List Price Range
360 2 Previous Price Range
380 2 Sold Price Range
700 1 House Description
The data is sorted by seq_no and then search_level represents its depth in the tree. So a seq_no 2 is a branch of a seq_no 1. In ASP I just used a script to change the display property of the tablerow it was in. I just cant figure out how to do this in .Net
This is how I did it in ASP
Code:<% do until rs.eof if rs("search_level")=1 and rs("name")="Status" then seqno=rs("seq_no") response.write "<script>" & vbcrlf response.write "function expandIt" & seqno & "(){" & vbcrlf response.write "sq" & seqno & ".style.display = (sq" & seqno & ".style.display == ""none"" ) ? """" : ""none"";" & vbcrlf response.write "}" & vbcrlf response.write "</script>" & vbcrlf response.write "<tr><td><font face=Verdana size=2><a href=searchf.asp?field=status target=searchbox>" & rs("name") & "</font></td></tr>" end if if rs("search_level")=1 and not rs("name")="Status" then response.write "</td></tr>" seqno=rs("seq_no") response.write "<script>" & vbcrlf response.write "function expandIt" & seqno & "(){" & vbcrlf response.write "sq" & seqno & ".style.display = (sq" & seqno & ".style.display == ""none"" ) ? """" : ""none"";" & vbcrlf response.write "}" & vbcrlf response.write "</script>" & vbcrlf response.write "<tr><td><font face=Verdana size=2><a href=# onclick=""expandIt" & seqno & "()"">" & rs("name") & "</font></td></tr><tr id=sq" & seqno & " style=""display:none;""><td>" end if if rs("search_level")=2 then response.write " <font face=Verdana size=1><a href=searchf.asp?field=" & rs("sys_name") & " target=searchbox>" & rs("name") & "</a></font></br>" end if rs.movenext loop %>




Reply With Quote