473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to include a menu?

All pages of my site contain a menu bar. This menu bar is some web control
(Aspxlab's BaseMenu). When adding a new page I simply copy this bar from
old page and paste it on the new one. So all my pages contain same control.
The problem is that when I need to make changes to the menu, I have to edit
all my pages.
Is there a way to exclude this menu from my pages, put it in a separate file
and
reference it from pages thru some link/method? I thought about server side
includes,
but the menu is not a plain HTML but a web control. So I don't imagine where
to put
a code associated with this menu control and how to access the menu from
page's codes.
Any ideas?
Nov 19 '05 #1
3 1237
Hello!

Looks like the job for User Control -> .ascx
Add new user control to the project, put the menu on it and use this
new user control, everywhere You need to see the menu.
--
Michal

Nov 19 '05 #2
In a couple weeks you can upgrade to ASP.NET 2.0, then you'll be able to
configure all your new menu controls to use a single Site Map as a data
source.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tumurbaatar S." <sp********@magicnet.mn> wrote in message
news:uR****************@TK2MSFTNGP09.phx.gbl...
All pages of my site contain a menu bar. This menu bar is some web control
(Aspxlab's BaseMenu). When adding a new page I simply copy this bar from
old page and paste it on the new one. So all my pages contain same
control.
The problem is that when I need to make changes to the menu, I have to
edit all my pages.
Is there a way to exclude this menu from my pages, put it in a separate
file and
reference it from pages thru some link/method? I thought about server side
includes,
but the menu is not a plain HTML but a web control. So I don't imagine
where to put
a code associated with this menu control and how to access the menu from
page's codes.
Any ideas?

Nov 19 '05 #3
You can either use a UserControl or use ASP.NET 2.0's master page. You
can refer the included samples about how to use an user control with
the menu.
In addition to that, you can also call BaseMenu.LoadMenu:
http://www.aspxlab.com/doc/AspxLab.W....LoadMenu.html

http://www.aspxlab.com
Most Easy to Use and Feature Packed
ASP.NET Menu and Slide Menu Control

Tumurbaatar S. wrote:
All pages of my site contain a menu bar. This menu bar is some web control
(Aspxlab's BaseMenu). When adding a new page I simply copy this bar from
old page and paste it on the new one. So all my pages contain same control.
The problem is that when I need to make changes to the menu, I have to edit
all my pages.
Is there a way to exclude this menu from my pages, put it in a separate file
and
reference it from pages thru some link/method? I thought about server side
includes,
but the menu is not a plain HTML but a web control. So I don't imagine where
to put
a code associated with this menu control and how to access the menu from
page's codes.
Any ideas?


Nov 19 '05 #4

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

Similar topics

9
by: Andy Jacobs | last post by:
Hi All I've tried as many combinations as I can think of but I'm not getting any where. This is what I have: <? $menu = 'menus/' . $HTTP_GET_VARS . '.inc'; echo $menu; ?>
1
by: RWC | last post by:
Hey Folks! I'm having trouble with an asp page. First off, I'm new to the html / asp world, but not to software development. I'd like to minimize or "normalize" the site, so I'm trying to use...
2
by: MDW | last post by:
I’ve got a menu file that’s saved as an .shtml document. I don’t want to post the code, but essentially it’s a simple HTML table, with an XSL template wrapped around it. This way, I can...
10
by: EnjoyNews | last post by:
I have a php site I have an include line called "include 'Cookie.php';" In this Cookie.php file I have these codes. <?php $conn = mysql_connect("$db", "$user", "$pass");...
5
by: Franz | last post by:
Hi, I would like to include a aspx file inside a script-block, however, I don't want to include that file by <!-- #include virtual="whateverfile" -->. How can I do it? Thanks. Franz
23
by: Big Bill | last post by:
http://www.promcars.co.uk/pages/bonnie.php I don't believe they should be there, can I take them out without stopping the includes from functioning? I'm the (hapless) optimiser on this one... I...
13
by: Heikki | last post by:
first. sory about bad english. my index.php has link-menu in a right side, that opens something.php next to the menu. something.php has a link link-menu at the top of the page that should...
4
by: sales | last post by:
I have used Include pages for a menu bar within a webpage - See below. <!--webbot bot="Include" U-Include="menu-categories.htm" TAG="BODY" -- It works fine when the page is htm format, but when...
12
by: Geoff Cox | last post by:
Hello I'm having a problem loading a frameset file using an include in a php file. Nothing is displayed and when I look at the source code I see that <html> <head> <title></title>
2
by: Rodger | last post by:
All, I am looking to re-work my main page and have been using include statements on it and I now want to add another section, but this time my include is ASP. If I pull the ASP up by itself it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.