473,385 Members | 1,582 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,385 software developers and data experts.

Structure of website

Hi all,

using 1.1

I am creating a dynamic menu structure for my site, however, I may refer to
the structure many times within a page. This would be fine if I was doing it
all in the codebehind of the page, but I am trying to create seperate tiers
for seperate areas. The menu structure I suppose is a middle tier...

The menu is built using a recursive function to build the tree. My page
would normally call a seperate class and function to build the menu. This
would effectively mean that every time I wanted to use the menu in whatever
classes elsewhere in my page, I would have to create the menu from scratch
again to work with it.

This is what I am trying to avoid, as it can be an expensive process to call
the database for every operation.

To throw more confusion into the pot, my page codebehind is derived from my
own class, which is in turn derived from system.web.ui.page. This means that
the codebehind for the page itself has very little code in it, all the work
being done in my derived class.

On the page itself, I have custom controls and user controls. The user
controls also work like the pages where the codebehind is derived from my
derived class, which derives from usercontrol. The custom and user controls
must also be able to work with the menu class.

Where would be the best place to set up the initial menu, so that my derived
page, the page codebehind and my controls can all interact with it, without
having to build the menu each time?

Thanks for your time. If this is a little confusing, please ask me to
attempt to make it clearer.

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Nov 9 '06 #1
2 1457
Hi,

I am guessing that I didn't phrase this question easily...

Basically, I want to have a base class that on the first call to the page,
creates and populates a menu object.

When I need to refer to the menu at any time within the page (such as
creating a menu tree or finding which page I am on through following the menu
tree, or creating a breadcrumb trail), I don't want to have to create a menu
class for each instance.

What may add to the confusion is that my page, user controls and custom
controls derive from my own base classes, so there is an extra layer of
confusion. I would like my page base class to be able to know about the menu
(which can pass it to the page class), and my UCs base class to know about
it, which can pass to the UC codebehind.

I don't mind creating the menu for each page, but I really only want to
create it once, because it uses a database call, I don't want to have an
expensive process for each use of it.

All help is appreciated.

Regards,
Dave Colliver.
http://www.DerbyFOCUS.com
~~
http://www.FOCUSPortals.com - Portal franchises available

"David" wrote:
Hi all,

using 1.1

I am creating a dynamic menu structure for my site, however, I may refer to
the structure many times within a page. This would be fine if I was doing it
all in the codebehind of the page, but I am trying to create seperate tiers
for seperate areas. The menu structure I suppose is a middle tier...

The menu is built using a recursive function to build the tree. My page
would normally call a seperate class and function to build the menu. This
would effectively mean that every time I wanted to use the menu in whatever
classes elsewhere in my page, I would have to create the menu from scratch
again to work with it.

This is what I am trying to avoid, as it can be an expensive process to call
the database for every operation.

To throw more confusion into the pot, my page codebehind is derived from my
own class, which is in turn derived from system.web.ui.page. This means that
the codebehind for the page itself has very little code in it, all the work
being done in my derived class.

On the page itself, I have custom controls and user controls. The user
controls also work like the pages where the codebehind is derived from my
derived class, which derives from usercontrol. The custom and user controls
must also be able to work with the menu class.

Where would be the best place to set up the initial menu, so that my derived
page, the page codebehind and my controls can all interact with it, without
having to build the menu each time?

Thanks for your time. If this is a little confusing, please ask me to
attempt to make it clearer.

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Nov 10 '06 #2
Hi all,

I am really struggling with this still. Any help would be appreciated...

I don't know if this will work, I am thinking along the lines of ...

In my base page, in the page_init (override), create a new instance of the
class that calls the database for the menu, and create the menu structure
into a dataset (or my own structure)

Then, in my controls (or even the page itself), open the dataset (or my own
structure) that has been created from the base page.

So, for example, I have a data layer... if I have a property in the
datalayer class that stores my dataset, that I populate on the page_init,
when I come to use it in the controls, can I do something as simple as...

MyMenu = this.Menu as MyClass.Menu;

(I am using c#, .net 1.1)

Will it then access the already created Menu?

If it is likely to work, I am not sure of the way to code it. Any help here
is appreciated.

If you don't think it will work the way outlined above, but know of another
way, again, any help is appreciated.

The idea is to just call the database once for something that is likely to
be expensive to create. I don't need it on application or session level.
Page level will be fine. The problem with application or session level is
that if any changes are made to the menu structure, they won't be visible
until it has timed out.

Thanks for your time.

Best regards,
Dave Colliver.
http://www.CardiffFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"David Colliver" <Da***********@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
Hi,

I am guessing that I didn't phrase this question easily...

Basically, I want to have a base class that on the first call to the page,
creates and populates a menu object.

When I need to refer to the menu at any time within the page (such as
creating a menu tree or finding which page I am on through following the
menu
tree, or creating a breadcrumb trail), I don't want to have to create a
menu
class for each instance.

What may add to the confusion is that my page, user controls and custom
controls derive from my own base classes, so there is an extra layer of
confusion. I would like my page base class to be able to know about the
menu
(which can pass it to the page class), and my UCs base class to know about
it, which can pass to the UC codebehind.

I don't mind creating the menu for each page, but I really only want to
create it once, because it uses a database call, I don't want to have an
expensive process for each use of it.

All help is appreciated.

Regards,
Dave Colliver.
http://www.DerbyFOCUS.com
~~
http://www.FOCUSPortals.com - Portal franchises available

"David" wrote:
>Hi all,

using 1.1

I am creating a dynamic menu structure for my site, however, I may refer
to
the structure many times within a page. This would be fine if I was doing
it
all in the codebehind of the page, but I am trying to create seperate
tiers
for seperate areas. The menu structure I suppose is a middle tier...

The menu is built using a recursive function to build the tree. My page
would normally call a seperate class and function to build the menu. This
would effectively mean that every time I wanted to use the menu in
whatever
classes elsewhere in my page, I would have to create the menu from
scratch
again to work with it.

This is what I am trying to avoid, as it can be an expensive process to
call
the database for every operation.

To throw more confusion into the pot, my page codebehind is derived from
my
own class, which is in turn derived from system.web.ui.page. This means
that
the codebehind for the page itself has very little code in it, all the
work
being done in my derived class.

On the page itself, I have custom controls and user controls. The user
controls also work like the pages where the codebehind is derived from my
derived class, which derives from usercontrol. The custom and user
controls
must also be able to work with the menu class.

Where would be the best place to set up the initial menu, so that my
derived
page, the page codebehind and my controls can all interact with it,
without
having to build the menu each time?

Thanks for your time. If this is a little confusing, please ask me to
attempt to make it clearer.

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

Nov 11 '06 #3

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

Similar topics

12
by: David Turner | last post by:
Hi All!, Does anyone know a link to a website or know the best way to create a data structure that will pick random elements from itself with assigned probabilities? For example, say I...
1
by: drinc2much | last post by:
Let me just start out by saying that I am a Java webapp developer. I was pulled into rebuilding our intranet site. I have limited experience with what is the best method for structuring an intranet...
8
by: yurps | last post by:
Hello, I want to create business and data access layer for my website. I am not sure what the right way to go is, I could use a code-generation tool, but want to understand a bit more about...
3
by: Imran Aziz | last post by:
Hello All, I want to develop a website that has three panels, the left and right panel needs to include code from common or other sections then the middle panel. Now in ASP the way we use to do it...
3
by: RBCC | last post by:
I have a form with a listbox and two textboxes. In the listbox I have the make and models of automobiles. and as the user clicks on the make of the car in the listbox I would like to output the make...
14
by: Mikee Freedom | last post by:
Good Morning all, New member to the list, hoping you might be able to give me some much needed advice. Basically, I have a client who would like to offer the ability for his users to have...
1
by: Frank Miverk | last post by:
Hi, I have a situation which I think is fairly common. 1. Public area 2. Secure area accessed via SSL e.g. MyWebsite/ /MySecureWebsite
2
by: Phoenix | last post by:
Hi Friends , Could anyone please help me to resolve the following issue : I pass an array of structures to a dll written in VC++ 6.0 whih fills it with data . The following works well for VB...
0
by: alexejpevzner | last post by:
Hi, I'd like to ask for help about Access, ASP - all this is new for me... I'd like to make an Access based website for searching, comparing and adding some electrical appliances. These...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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,...
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...

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.