473,785 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1257
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
"Tumurbaata r S." <sp********@mag icnet.mn> wrote in message
news:uR******** ********@TK2MSF TNGP09.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.LoadMe nu:
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
2292
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
1635
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 one menu page and include it into any page that needs the menu. The problem is, I include the header.asp page, include the menu.asp page, but when I write the body of the page, it sticks the text underneath the side menu. I'd like the text to...
2
1627
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 include the file from HTML, ASP, or from an XML stylesheet. The actual file inclusion works fine. My problem is that the menu uses images, which are saved in a different directory than the include file itself. The overall web structure is this: ...
10
3158
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"); mysql_select_db("$db"); //-------------------------------------------------------------------------- -------------
5
3764
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
3101
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 have to correct where they've spelled my name wrong too...sigh... BB --
13
2296
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 open stuff.php under this last menu. the broblem is that stuff.php opens to the place of something.php. so the top link-menu disapears.
4
1783
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 I use the page in php format, all the menus that are an Included link do not show. Any ideas??? Thanks
12
5625
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
4294
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 works just fine. How ever when I have it in my default.htm page the ASP does not execute so when I look at the source I see all the ASP Code. any idea what I need to set? Here is the code in my main page for the include. <P align=CENTER...
0
9647
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
9485
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,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10098
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
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7506
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
5390
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...
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2890
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.