Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Thursday, March 22, 2012

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 availableHi,

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:

Quote:

Originally Posted by

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
>
>
>


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" <DavidColliver@.discussions.microsoft.comwrote in message
news:FA252579-0E4C-41FD-979D-171CA8DB9E8F@.microsoft.com...

Quote:

Originally Posted by

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:
>

Quote:

Originally Posted by

>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
>>
>>
>>

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 availableHi,
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 men
u
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 t
o
> 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 tier
s
> 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 whateve
r
> 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 ca
ll
> the database for every operation.
> To throw more confusion into the pot, my page codebehind is derived from m
y
> own class, which is in turn derived from system.web.ui.page. This means th
at
> the codebehind for the page itself has very little code in it, all the wor
k
> 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 control
s
> 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 deriv
ed
> page, the page codebehind and my controls can all interact with it, withou
t
> 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
>
>
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" <DavidColliver@.discussions.microsoft.com> wrote in message
news:FA252579-0E4C-41FD-979D-171CA8DB9E8F@.microsoft.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:
>

Tuesday, March 13, 2012

Strucuture of an Asp.NET Intranet

Hi,

We have recently begun to upgrade our classic ASP intranet to ASP.NET.

We will be creating functional projects and different projects for
different departmental sites.

All the sites have common facets (user controls, custom controls) which
need to have available to all the projects we write and automatically
cascade to the other projects

(i.e. no rebuilding of dependent projects)

Can anyone suggest the best way of achieving this or a good source of
literature. Everything I have read so far has been a bit thin in this
area.

Many thanksthe easiest way to do this is the side by side model and a source control
system. put your shared controls in their own project. then add this project
to the solution file of each site. when you deploy a site, you will get a
copy of the shared code that was tested with the site. you can freely update
the shared code, because it will not break a running site, and a site that
needs a new feature in the shared code can ship right away, rather than
waiting for compliance testing of the change with the other sites.

-- bruce (sqlwork.com)

"Bob" <Arthur.Nyunt@.kellogg.com> wrote in message
news:1121184177.802972.227110@.o13g2000cwo.googlegr oups.com...
> Hi,
> We have recently begun to upgrade our classic ASP intranet to ASP.NET.
> We will be creating functional projects and different projects for
> different departmental sites.
> All the sites have common facets (user controls, custom controls) which
> need to have available to all the projects we write and automatically
> cascade to the other projects
> (i.e. no rebuilding of dependent projects)
> Can anyone suggest the best way of achieving this or a good source of
> literature. Everything I have read so far has been a bit thin in this
> area.
> Many thanks
Bruce,

Thanks for your reply.

I have created an empty project and created a user control, then tried
to add the project to solution file of a web application. I got a error
message saying that I was trying to access another application.

Could I just ask you

1) Is this because I need to run some source control program such as
source safe (as you mentioned source control)

2) Also could you clarify what is meant by a side by side model - I
have looked around and not found any references to this

Thanks

Arthur
i didn't read closely. usercontrols (ascx) don't share very well, as they
can not be in a seperate project (well they can but you have to fake out
vs). standard custom web controls (which i use) work fine.

to share usercontrols, it easy with a source control, because you jusrt add
a link to the shared source, and add the files to the current project.

-- bruce (sqlwork.com)

"Bob" <Arthur.Nyunt@.kellogg.com> wrote in message
news:1121187092.565144.76500@.z14g2000cwz.googlegro ups.com...
> Bruce,
> Thanks for your reply.
> I have created an empty project and created a user control, then tried
> to add the project to solution file of a web application. I got a error
> message saying that I was trying to access another application.
> Could I just ask you
> 1) Is this because I need to run some source control program such as
> source safe (as you mentioned source control)
> 2) Also could you clarify what is meant by a side by side model - I
> have looked around and not found any references to this
> Thanks
> Arthur