473,670 Members | 2,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic main menu

ok i tell u in detail.

database is:

menu_bar option_no menu_option
1 0 a
2 1 b
3 2 c
4 2 d
5 1 e
6 1 f
7 0 g
8 7 h
9 7 i
10 9 j
11 9 k
12 7 l
my coding is:

Dim mainMenu1 As New MainMenu
Dim menuItem As New MenuItem

conn.Open()
cmd.CommandText = "select * from user_profile where
option_no=0"
cmd.Connection = conn
dr = cmd.ExecuteRead er
While dr.Read
menuItem.Text = Convert.ToStrin g(dr(1))
mainMenu1.MenuI tems.Add(menuIt em.Text)
End While

dr.Close()
conn.Close()
Menu = mainMenu1
and output should be:

a g
|->b |->h
. |->c |->i
. |->d . |->j
|->e . |->k
|->f |->l
this code adds "a" and "g" but i m unable to add rest of child and sub
child items.
i have shown u the database hope u can generate dynamic main menu from
there as output is required.

Aug 17 '06 #1
2 1013
You are only selecting 'a' and 'g' when you restrict your record
selection with "where option_no = 0".
Where are the sub-menus for 'a' and 'g' supposed to come from?

T

varun kanwar wrote:
>ok i tell u in detail.

database is:

menu_bar option_no menu_option
1 0 a
2 1 b
3 2 c
4 2 d
5 1 e
6 1 f
7 0 g
8 7 h
9 7 i
10 9 j
11 9 k
12 7 l
my coding is:

Dim mainMenu1 As New MainMenu
Dim menuItem As New MenuItem

conn.Open()
cmd.CommandText = "select * from user_profile where
option_no=0"
cmd.Connection = conn
dr = cmd.ExecuteRead er
While dr.Read
menuItem.Text = Convert.ToStrin g(dr(1))
mainMenu1.MenuI tems.Add(menuIt em.Text)
End While

dr.Close()
conn.Close()
Menu = mainMenu1
and output should be:

a g
|->b |->h
. |->c |->i
. |->d . |->j
|->e . |->k
|->f |->l
this code adds "a" and "g" but i m unable to add rest of child and sub
child items.
i have shown u the database hope u can generate dynamic main menu from
there as output is required.
Aug 17 '06 #2

cmd.CommandText = "select * from user_profile"

ok llets change the command to this but even then how will i
distinguish between parent menu and child menu.

and big problem is where to right code to add child menu to parent menu.

Aug 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2128
by: Chris45 | last post by:
Hi , Trying to get a menu working for sometime now have wasted money on stupid software etc.Now have been trying out a freebee from www.dynamicdrive.com, but have one or two question. It's properly better if I was to show you it so have uploaded it to with a couple of question. http://teaup.port5.com/test/ This is where my problem starts how do I make the menu veawable over this frame ? Then the next problem is how would one make the...
1
1631
by: Phil | last post by:
Supposedly, the code below should assign the correct value to the 'url' variable. But all I get is a blank 'main' Frame with apparently nowhere to go when I click on the link in the 'menu' Frame.. Worst(yesyes!!) 1 - Explorer 6 : clicking a link in the 'menu' frame simple reopens an instance of the FRAMESET, syntax error msg. 2 - Netscape 7.1 : clicking a link in the 'menu' frame simple reopens
1
2519
by: Martin Falta | last post by:
Hi all, I need a help with following problem. I need to create a menu from dynamic loaded assembly on the main form of my application. The menu is created succesfully, but the events of this menu, which are defined in the dynamic loaded assembly, are not raised. How can I raise them? Martin
1
4283
by: tribal boy | last post by:
Guys, I am using a dynamic menu which uses xml,xsl a css file and javascript. This works fine when there are no server controls around or underneath it. The problem is whenever the menu encounters a server control, it closes itself.
2
1396
by: guoqi zheng | last post by:
Dear Sir, I have a menu page (main.aspx") with a placeholder on it. This placeholder will load a a main menu item user controls (mainmenu.ascx), on this page, there are a few menu items, When user clicks one of those menu items, placeholder will be clean and load another user control (e.g. uc1test.ascx). I have below code on click event at mainmenu.ascx, obviously these code did not work out. What did I do wrong here?
3
4785
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be dynamically generated, and the dynamic generation needs to occur right when the user selects this menu item (that is on the Popup event handler). However, everytime I put following code on the Popup event handler (of the View Files menuitem) to dynamically...
2
1442
by: libish | last post by:
hi all... can any one help me by suggesting a way to add event to a dynamic form? here what i'm doing is , i'm displaying a dynamic form. in that form i have a main menu and this main menu contains a menu item "OK" i want to add an event to this ok item so that some action can occur while clicking on it... can any one help me by suggesting an idea...
4
1843
by: libish | last post by:
hi all... can any one help me by suggesting a way to get items in dynamic form? here what i'm doing is , i'm displaying a dynamic form. in that form i have a main menu and this main menu contains a menu item "OK". here the dynamic form consist of some labels, list items and all. when i click on the "OK" menu item, an event occurs and i've wrote methods which wll execute on this event. now i need the selected list item index,value.. label...
1
1210
by: jeddiki | last post by:
Hi I have a dynamic menu on my site and it uses javascript to make slide up and down the page. I think its pretty cool but it seems that it works independently of the page so if you try and reduce the width of the window, it starts getting messed up. Have a look here and you will see what I mean: my website
0
8469
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8592
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8661
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6213
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5684
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2042
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.