Hello.I want tocreatenestedCategorized.We were doingthis workwith
classic
ASP,
as far as
the recurse
function.
Would
you give some examples?The tablestructureis ready.(ie),
id, parent andchildpresentstructure.I justwant tofunction.Thanks.
Function Fncat(cat,step,hcat)
SQLStr = "Select * From cat Where UId="&cat&" Order By date Asc"
Set Rs = Con.Execute(SQLStr)
step = step + 1
Do While Not Rs.Eof
spc = ""
for i=0 to step*8
spc=spc&" "
Next
if Rs("Id")=hcat then SSec=" Selected" else SSec="" end if
Response.Write("<option value="""&Rs("Id")&""""&SSec&">"&spc&Rs("cat")&"</option>")
Fncat Rs("Id"), step, hcat
Rs.Movenext
step = step - 1
Loop
Rs.Close
Set Rs= Nothing
End Function
How do those map across the the VBScript function you posted earlier? Can you also provide an example of values that you would pass to the old version of the function and the expected output?
above, the sampleasp codeI wrote.my aim isto establishan unlimitedcategory structure.I didas I saidabove,the table structure.Now,I want to showall thecategoriesin a tree form.
sample;
Root
Root - Mainboard
Root - CPU
Root - CPU - AMD
Root - CPU - INTEL
Root - CPU - INTEL - 775p
Root - CPU - INTEL - 1156p Root - MONITOR
Root - MONITOR - LCD
aspnet1071
Member
64 Points
35 Posts
Nested Category Recurse
Jul 01, 2011 12:47 PM|LINK
Hello. I want to create nested Categorized. We were doing this work with classic ASP, as far as the recurse function. Would you give some examples? The table structure is ready. (ie), id, parent and child present structure. I just want to function. Thanks.
Mikesdotnett...
All-Star
155649 Points
19987 Posts
Moderator
MVP
Re: Nested Category Recurse
Jul 01, 2011 02:11 PM|LINK
Can you provide the classic ASP function you are using?
Web Pages CMS | My Site | Twitter
aspnet1071
Member
64 Points
35 Posts
Re: Nested Category Recurse
Jul 01, 2011 03:58 PM|LINK
Function Fncat(cat,step,hcat) SQLStr = "Select * From cat Where UId="&cat&" Order By date Asc" Set Rs = Con.Execute(SQLStr) step = step + 1 Do While Not Rs.Eof spc = "" for i=0 to step*8 spc=spc&" " Next if Rs("Id")=hcat then SSec=" Selected" else SSec="" end if Response.Write("<option value="""&Rs("Id")&""""&SSec&">"&spc&Rs("cat")&"</option>") Fncat Rs("Id"), step, hcat Rs.Movenext step = step - 1 Loop Rs.Close Set Rs= Nothing End Functionaspnet1071
Member
64 Points
35 Posts
Re: Nested Category Recurse
Jul 02, 2011 09:47 AM|LINK
answer pls
aspnet1071
Member
64 Points
35 Posts
Re: Nested Category Recurse
Jul 04, 2011 09:24 AM|LINK
Do not have nobody to do the translation of the above code?
aspnet1071
Member
64 Points
35 Posts
Re: Nested Category Recurse
Jul 06, 2011 11:36 AM|LINK
Mikesdotnetting, pls help me!
Mikesdotnett...
All-Star
155649 Points
19987 Posts
Moderator
MVP
Re: Nested Category Recurse
Jul 06, 2011 12:42 PM|LINK
Can you provide more details of the relevant table structure?
Web Pages CMS | My Site | Twitter
aspnet1071
Member
64 Points
35 Posts
Re: Nested Category Recurse
Jul 06, 2011 01:23 PM|LINK
Category Table
Id -> int
Category -> nvarchar
ParentId -> int
Mikesdotnett...
All-Star
155649 Points
19987 Posts
Moderator
MVP
Re: Nested Category Recurse
Jul 06, 2011 04:27 PM|LINK
How do those map across the the VBScript function you posted earlier? Can you also provide an example of values that you would pass to the old version of the function and the expected output?
Web Pages CMS | My Site | Twitter
aspnet1071
Member
64 Points
35 Posts
Re: Nested Category Recurse
Jul 06, 2011 04:54 PM|LINK
above, the sample asp code I wrote. my aim is to establish an unlimited category structure. I did as I said above, the table structure. Now, I want to show all the categories in a tree form.
sample;
Root
Root - Mainboard
Root - CPU
Root - CPU - AMD
Root - CPU - INTEL
Root - CPU - INTEL - 775p
Root - CPU - INTEL - 1156p
Root - MONITOR
Root - MONITOR - LCD