Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6142231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:21:29+00:00 2026-05-23T18:21:29+00:00

I have a problem regarding asp.My problem is;the table structure something like that.And those

  • 0

I have a problem regarding asp.My problem is;the table structure something like that.And those columns have called MenuID,Alt_MenuID,Menu_Adi. Finally, I want to display those items within menu_adi column from menu table.

For Example;

MenuID   Alt_MenuID   Menu_Adi

1           0         Anasayfa
2           0         Urunler
3           2         Bisiklet (Alt_MenuID=2 is equal to MenuID=2,So the sub menu of urunler is bisiklet) 
4           3         Üç Tekerlekli Bisiklet (Alt_MenuID=3 is equal to MenuID=3.So,the sub menu of bisiklet is Üç Tekerlekli Bisiklet) 
5           0         İletişim
6           5         Harita(sub menu of the iletişim)

I want to display like that.

- Anasayfa
- Ürünler
- - Bisiklet (sub menu)
- - - Üç tekerlekli bisiklet ( sub menu of the bisiklet)
- İletişim
- - Harita ( sub menu)

I’m using the function as below for that.

<%function MenuYazdir(MenuID,say) 

Set Liste = Data.Execute("Select MenuID,Alt_MenuID,MenuAd From Menuler Where   Alt_MenuID="& MenuID)
if Liste.Eof=False Then
 Do Until.Liste.Eof
  Response.write("-"& Liste("MenuAd") &"<br>")
  call MenuYazdir(Liste("MenuID"),0)
Liste.MoveNext
Loop
 End if
Set Liste = Nothing

End function%>

<% call MenuYazdir(0,0)%> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:21:31+00:00Added an answer on May 23, 2026 at 6:21 pm

    You’re on the right path with a recursive function and a “parent” field, however you seem to be using a function like a sub, doesn’t really matter just not the “conventional” way of doing things.

    To get the right number of dashes before the item, pass a level variable and increment it before calling the recurse.

    Try something like this:

    <%
    Function MenuYazdir(MenuID,strOutput, intLevel) 
    
        Set Liste = Data.Execute("Select MenuID,Alt_MenuID,MenuAd From Menuler Where   Alt_MenuID="& MenuID)
        Do While NOT Liste.Eof
            For i = 1 to intLevel
                strOutput = stroutput & "- "
            Next
            strOutput = strOutput & Liste("MenuAd") &"<br>"
            intLevel = intLevel + 1
            strOutput = MenuYazdir(Liste("MenuID"), strOutput, intLevel)
            intLevel = intLevel -1
            Liste.MoveNext
        Loop
        Set Liste = Nothing
    
    End Function
    %>
    
    <%= MenuYazdir(0,0) %>
    

    I’ve removed the need for the if/end if and turned it to a proper function so you can do more with the output (and so you can pass it back into the recurse).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem regarding to asp.net lifecylce hierarchy. Basically, I have one user
I have a problem with a master page containing a asp:textbox that I'm trying
I have a problem regarding getting the path of a user control. The scenario
I have a problem regarding StartUp Url in WPF. I have a LoginView.xaml and
I have a problem regarding the datediff MYSQL function, I can use it and
I have a question regarding a problem with L2S, Autogenerated DataContext and the use
I actually have two questions regarding the same problem but I think it is
I have problem in some JavaScript that I am writing where the Switch statement
I am going through a weird problem right now regarding routing in ASP.NET WebForms.
I am using asp.net mvc 2.0(default binding model) and I have this problem. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.