Showing posts with label number. Show all posts
Showing posts with label number. Show all posts

Thursday, March 29, 2012

Performance Q..

My development environments are ASP.Net and VB.Net and .NetFramework1.1.

I remember reading "using less number of session variables is good for
application performance".

Now instead of using 20 session variables, I can use one session variable
which carries the data for all the 20 variables that I want to keep track.

Is it a good idea? Any documentation on how exactly the sessions variables
are processed and stored in IIS5?

Thanks,

Lalit SinghPerformance generally falls into 2 categories: Processor and Memory.
Anything which saves Processor usage or Memory usage improves performance.
If you can remember that, you can stop relying on opinions you read to
determine what you should do.

Session is memory. Anything which reduces Session size will improve
performance. Combining Session variables into a single object isn't likely
to improve performance, as you aren't changing the size of anything, just
how it is stored. If I put 5 apples in a box, I still have 5 apples. I also
have the box now.

Programming instructions are Processor. If, by putting all of these objects
into a single object enables you to write leaner code, you will improve
performance. For example, using the apples again, taking the apples out of
Session one at a time, I need to write 5 sets of instructions, or a loop
that executes 5 times. If I take the box out, I use only 1 instruction. Of
course, at some point you're going to need to take the apples out of the
box. So, that kind of cancels out the savings there.

But let me get back to my original point: Don't rely on opinions. If you're
really concerned about performance, keep your eye on Memory usage and
Processor usage. Don't concentrate on Session. Concentrate on your whole
app. Look for opportunites to write leaner code, and maximize memory usage.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
> My development environments are ASP.Net and VB.Net and .NetFramework1.1.
> I remember reading "using less number of session variables is good for
> application performance".
> Now instead of using 20 session variables, I can use one session variable
> which carries the data for all the 20 variables that I want to keep track.
> Is it a good idea? Any documentation on how exactly the sessions variables
> are processed and stored in IIS5?
> Thanks,
> Lalit Singh
Thanks,
I was waiting to post during this hour of the day so that you will respond.
Thanks,
Lalit

"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:#X6bD6g3EHA.3708@.TK2MSFTNGP14.phx.gbl...
> Performance generally falls into 2 categories: Processor and Memory.
> Anything which saves Processor usage or Memory usage improves performance.
> If you can remember that, you can stop relying on opinions you read to
> determine what you should do.
> Session is memory. Anything which reduces Session size will improve
> performance. Combining Session variables into a single object isn't likely
> to improve performance, as you aren't changing the size of anything, just
> how it is stored. If I put 5 apples in a box, I still have 5 apples. I
also
> have the box now.
> Programming instructions are Processor. If, by putting all of these
objects
> into a single object enables you to write leaner code, you will improve
> performance. For example, using the apples again, taking the apples out of
> Session one at a time, I need to write 5 sets of instructions, or a loop
> that executes 5 times. If I take the box out, I use only 1 instruction. Of
> course, at some point you're going to need to take the apples out of the
> box. So, that kind of cancels out the savings there.
> But let me get back to my original point: Don't rely on opinions. If
you're
> really concerned about performance, keep your eye on Memory usage and
> Processor usage. Don't concentrate on Session. Concentrate on your whole
> app. Look for opportunites to write leaner code, and maximize memory
usage.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
> news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
> > My development environments are ASP.Net and VB.Net and .NetFramework1.1.
> > I remember reading "using less number of session variables is good for
> > application performance".
> > Now instead of using 20 session variables, I can use one session
variable
> > which carries the data for all the 20 variables that I want to keep
track.
> > Is it a good idea? Any documentation on how exactly the sessions
variables
> > are processed and stored in IIS5?
> > Thanks,
> > Lalit Singh

Performance Q..

My development environments are ASP.Net and VB.Net and .NetFramework1.1.
I remember reading "using less number of session variables is good for
application performance".
Now instead of using 20 session variables, I can use one session variable
which carries the data for all the 20 variables that I want to keep track.
Is it a good idea? Any documentation on how exactly the sessions variables
are processed and stored in IIS5?
Thanks,
Lalit SinghPerformance generally falls into 2 categories: Processor and Memory.
Anything which saves Processor usage or Memory usage improves performance.
If you can remember that, you can stop relying on opinions you read to
determine what you should do.
Session is memory. Anything which reduces Session size will improve
performance. Combining Session variables into a single object isn't likely
to improve performance, as you aren't changing the size of anything, just
how it is stored. If I put 5 apples in a box, I still have 5 apples. I also
have the box now.
Programming instructions are Processor. If, by putting all of these objects
into a single object enables you to write leaner code, you will improve
performance. For example, using the apples again, taking the apples out of
Session one at a time, I need to write 5 sets of instructions, or a loop
that executes 5 times. If I take the box out, I use only 1 instruction. Of
course, at some point you're going to need to take the apples out of the
box. So, that kind of cancels out the savings there.
But let me get back to my original point: Don't rely on opinions. If you're
really concerned about performance, keep your eye on Memory usage and
Processor usage. Don't concentrate on Session. Concentrate on your whole
app. Look for opportunites to write leaner code, and maximize memory usage.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
> My development environments are ASP.Net and VB.Net and .NetFramework1.1.
> I remember reading "using less number of session variables is good for
> application performance".
> Now instead of using 20 session variables, I can use one session variable
> which carries the data for all the 20 variables that I want to keep track.
> Is it a good idea? Any documentation on how exactly the sessions variables
> are processed and stored in IIS5?
> Thanks,
> Lalit Singh
>
Thanks,
I was waiting to post during this hour of the day so that you will respond.
Thanks,
Lalit
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:#X6bD6g3EHA.3708@.TK2MSFTNGP14.phx.gbl...
> Performance generally falls into 2 categories: Processor and Memory.
> Anything which saves Processor usage or Memory usage improves performance.
> If you can remember that, you can stop relying on opinions you read to
> determine what you should do.
> Session is memory. Anything which reduces Session size will improve
> performance. Combining Session variables into a single object isn't likely
> to improve performance, as you aren't changing the size of anything, just
> how it is stored. If I put 5 apples in a box, I still have 5 apples. I
also
> have the box now.
> Programming instructions are Processor. If, by putting all of these
objects
> into a single object enables you to write leaner code, you will improve
> performance. For example, using the apples again, taking the apples out of
> Session one at a time, I need to write 5 sets of instructions, or a loop
> that executes 5 times. If I take the box out, I use only 1 instruction. Of
> course, at some point you're going to need to take the apples out of the
> box. So, that kind of cancels out the savings there.
> But let me get back to my original point: Don't rely on opinions. If
you're
> really concerned about performance, keep your eye on Memory usage and
> Processor usage. Don't concentrate on Session. Concentrate on your whole
> app. Look for opportunites to write leaner code, and maximize memory
usage.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
> news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
variable
track.
variables
>

Wednesday, March 21, 2012

Permissions Issues with ASPNET Account

For some unexplained reason, I am suddenly unable to browse to a virtual
directory on my laptop. I have a number of sample websites to which I could
happliy browse up until last w. As of Monday, if I browse to any of the
sites, I get an HttpException saying "The directory does not exist or is not
accessible because of security settings." I honestly have not changed
anything at all.
I have checked and re-checked that ASPNET indeed has the three required
permissions on the virtual directories (ie. Read, Read & Execute, and List
Folder Contents). As a workaround, the only way that I am able to currently
browse to the sample websites is I 'upgrade' the access level privilege in
the machine.config as follows:
Go to folder C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG, and edit the
machine.config file. Find <processModel enable="true" timeout="Infinite"...
and change the username attribute from 'machine' to 'system'. Save the file,
and restart IIS.
I have trawled the internet in the last couple of days, and have discovered
many others have experienced the same problem. For most, it was a matter of
applying the ASPNET account permissions to the virtual folder, but there are
still a number of other people (like myself) for whom this problem persists.
I have even ran aspnet_regiis.exe, but still no joy.
My system specification is as follows:
Windows XP Professional SP1.
Internet Explorer 6.0.2800 SP2.
.NET Framework v1.1
Visual Studio .NET 2003
Below is the exception:
Server Error in '/EC315CH02' Application.
----
--
Server cannot access application directory 'E:\Documents and
Settings\...<SubFolders>...'. The directory does not exist or is not
accessible because of security settings.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information abou
t
the error and where it originated in the code.
Exception Details: System.Web.HttpException: Server cannot access
application directory 'E:\Documents and Settings\...<SubFolders>...'. The
directory does not exist or is not accessible because of security settings.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Server cannot access application directory
'E:\Documents and Settings\...<SubFolders>...'. The directory does not exis
t
or is not accessible because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +264
[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +990
System.Web.HttpRuntime. ProcessRequestInternal(HttpWorkerRequest
wr) +128
----
--
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
Does anyone know what could be the problem?
Can anyone provide any assistance to resolve it?
...Yogesh
"If a pig loses its voice, is it disgruntled?"Is E a mapped drive? A mapped drive works only for the current logon session
which isn't the one ASP.NET is running in since it's running as a different
user.
-Brock
DevelopMentor
http://staff.develop.com/ballen

> For some unexplained reason, I am suddenly unable to browse to a
> virtual directory on my laptop. I have a number of sample websites to
> which I could happliy browse up until last w. As of Monday, if I
> browse to any of the sites, I get an HttpException saying "The
> directory does not exist or is not accessible because of security
> settings." I honestly have not changed anything at all.
> I have checked and re-checked that ASPNET indeed has the three
> required permissions on the virtual directories (ie. Read, Read &
> Execute, and List Folder Contents). As a workaround, the only way that
> I am able to currently browse to the sample websites is I 'upgrade'
> the access level privilege in the machine.config as follows:
> Go to folder C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG, and
> edit the machine.config file. Find <processModel enable="true"
> timeout="Infinite"... and change the username attribute from
> 'machine' to 'system'. Save the file, and restart IIS.
> I have trawled the internet in the last couple of days, and have
> discovered many others have experienced the same problem. For most, it
> was a matter of applying the ASPNET account permissions to the virtual
> folder, but there are still a number of other people (like myself) for
> whom this problem persists. I have even ran aspnet_regiis.exe, but
> still no joy.
> My system specification is as follows:
> Windows XP Professional SP1.
> Internet Explorer 6.0.2800 SP2.
> .NET Framework v1.1
> Visual Studio .NET 2003
> Below is the exception:
> Server Error in '/EC315CH02' Application.
> ---
> --
> Server cannot access application directory 'E:\Documents and
> Settings\...<SubFolders>...'. The directory does not exist or is not
> accessible because of security settings. Description: An unhandled
> exception occurred during the execution of the current web request.
> Please review the stack trace for more information about the error and
> where it originated in the code.
> Exception Details: System.Web.HttpException: Server cannot access
> application directory 'E:\Documents and Settings\...<SubFolders>...'.
> The directory does not exist or is not accessible because of security
> settings.
> Source Error:
> An unhandled exception was generated during the execution of the
> current web request. Information regarding the origin and location of
> the exception can be identified using the exception stack trace below.
> Stack Trace:
> [HttpException (0x80004005): Server cannot access application
> directory
> 'E:\Documents and Settings\...<SubFolders>...'. The directory does
> not exist
> or is not accessible because of security settings.]
> System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
> System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +264
> [HttpException (0x80004005): ASP.NET Initialization Error]
> System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +990
> System.Web.HttpRuntime. ProcessRequestInternal(HttpWorkerRequest
wr)
> +128
> ---
> -- Version Information: Microsoft .NET Framework
> Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
> Does anyone know what could be the problem?
> Can anyone provide any assistance to resolve it?
>
No, Drive E is a local hard drive.
Cheers...
...Yogesh
"Brock Allen" wrote:

> Is E a mapped drive? A mapped drive works only for the current logon sessi
on
> which isn't the one ASP.NET is running in since it's running as a differen
t
> user.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>

Permissions Issues with ASPNET Account

For some unexplained reason, I am suddenly unable to browse to a virtual
directory on my laptop. I have a number of sample websites to which I could
happliy browse up until last week. As of Monday, if I browse to any of the
sites, I get an HttpException saying "The directory does not exist or is not
accessible because of security settings." I honestly have not changed
anything at all.

I have checked and re-checked that ASPNET indeed has the three required
permissions on the virtual directories (ie. Read, Read & Execute, and List
Folder Contents). As a workaround, the only way that I am able to currently
browse to the sample websites is I 'upgrade' the access level privilege in
the machine.config as follows:

Go to folder C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG, and edit the
machine.config file. Find <processModel enable="true" timeout="Infinite"...
and change the username attribute from 'machine' to 'system'. Save the file,
and restart IIS.

I have trawled the internet in the last couple of days, and have discovered
many others have experienced the same problem. For most, it was a matter of
applying the ASPNET account permissions to the virtual folder, but there are
still a number of other people (like myself) for whom this problem persists.
I have even ran aspnet_regiis.exe, but still no joy.

My system specification is as follows:

Windows XP Professional SP1.
Internet Explorer 6.0.2800 SP2.
..NET Framework v1.1
Visual Studio .NET 2003

Below is the exception:

Server Error in '/EC315CH02' Application.
------------------------

Server cannot access application directory 'E:\Documents and
Settings\...<SubFolders>...\'. The directory does not exist or is not
accessible because of security settings.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Web.HttpException: Server cannot access
application directory 'E:\Documents and Settings\...<SubFolders>...\'. The
directory does not exist or is not accessible because of security settings.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Server cannot access application directory
'E:\Documents and Settings\...<SubFolders>...\'. The directory does not exist
or is not accessible because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDi rectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContex t context) +264

[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContex t context) +990
System.Web.HttpRuntime.ProcessRequestInternal(Http WorkerRequest wr) +128

------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

Does anyone know what could be the problem?

Can anyone provide any assistance to resolve it?

--
...Yogesh
"If a pig loses its voice, is it disgruntled?"Is E a mapped drive? A mapped drive works only for the current logon session
which isn't the one ASP.NET is running in since it's running as a different
user.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> For some unexplained reason, I am suddenly unable to browse to a
> virtual directory on my laptop. I have a number of sample websites to
> which I could happliy browse up until last week. As of Monday, if I
> browse to any of the sites, I get an HttpException saying "The
> directory does not exist or is not accessible because of security
> settings." I honestly have not changed anything at all.
> I have checked and re-checked that ASPNET indeed has the three
> required permissions on the virtual directories (ie. Read, Read &
> Execute, and List Folder Contents). As a workaround, the only way that
> I am able to currently browse to the sample websites is I 'upgrade'
> the access level privilege in the machine.config as follows:
> Go to folder C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG, and
> edit the machine.config file. Find <processModel enable="true"
> timeout="Infinite"... and change the username attribute from
> 'machine' to 'system'. Save the file, and restart IIS.
> I have trawled the internet in the last couple of days, and have
> discovered many others have experienced the same problem. For most, it
> was a matter of applying the ASPNET account permissions to the virtual
> folder, but there are still a number of other people (like myself) for
> whom this problem persists. I have even ran aspnet_regiis.exe, but
> still no joy.
> My system specification is as follows:
> Windows XP Professional SP1.
> Internet Explorer 6.0.2800 SP2.
> .NET Framework v1.1
> Visual Studio .NET 2003
> Below is the exception:
> Server Error in '/EC315CH02' Application.
> ----------------------
> ----
> Server cannot access application directory 'E:\Documents and
> Settings\...<SubFolders>...\'. The directory does not exist or is not
> accessible because of security settings. Description: An unhandled
> exception occurred during the execution of the current web request.
> Please review the stack trace for more information about the error and
> where it originated in the code.
> Exception Details: System.Web.HttpException: Server cannot access
> application directory 'E:\Documents and Settings\...<SubFolders>...\'.
> The directory does not exist or is not accessible because of security
> settings.
> Source Error:
> An unhandled exception was generated during the execution of the
> current web request. Information regarding the origin and location of
> the exception can be identified using the exception stack trace below.
> Stack Trace:
> [HttpException (0x80004005): Server cannot access application
> directory
> 'E:\Documents and Settings\...<SubFolders>...\'. The directory does
> not exist
> or is not accessible because of security settings.]
> System.Web.HttpRuntime.EnsureAccessToApplicationDi rectory() +72
> System.Web.HttpRuntime.FirstRequestInit(HttpContex t context) +264
> [HttpException (0x80004005): ASP.NET Initialization Error]
> System.Web.HttpRuntime.FirstRequestInit(HttpContex t context) +990
> System.Web.HttpRuntime.ProcessRequestInternal(Http WorkerRequest wr)
> +128
> ----------------------
> ---- Version Information: Microsoft .NET Framework
> Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
> Does anyone know what could be the problem?
> Can anyone provide any assistance to resolve it?
No, Drive E is a local hard drive.

Cheers...

....Yogesh

"Brock Allen" wrote:

> Is E a mapped drive? A mapped drive works only for the current logon session
> which isn't the one ASP.NET is running in since it's running as a different
> user.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
> > For some unexplained reason, I am suddenly unable to browse to a
> > virtual directory on my laptop. I have a number of sample websites to
> > which I could happliy browse up until last week. As of Monday, if I
> > browse to any of the sites, I get an HttpException saying "The
> > directory does not exist or is not accessible because of security
> > settings." I honestly have not changed anything at all.
> > I have checked and re-checked that ASPNET indeed has the three
> > required permissions on the virtual directories (ie. Read, Read &
> > Execute, and List Folder Contents). As a workaround, the only way that
> > I am able to currently browse to the sample websites is I 'upgrade'
> > the access level privilege in the machine.config as follows:
> > Go to folder C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG, and
> > edit the machine.config file. Find <processModel enable="true"
> > timeout="Infinite"... and change the username attribute from
> > 'machine' to 'system'. Save the file, and restart IIS.
> > I have trawled the internet in the last couple of days, and have
> > discovered many others have experienced the same problem. For most, it
> > was a matter of applying the ASPNET account permissions to the virtual
> > folder, but there are still a number of other people (like myself) for
> > whom this problem persists. I have even ran aspnet_regiis.exe, but
> > still no joy.
> > My system specification is as follows:
> > Windows XP Professional SP1.
> > Internet Explorer 6.0.2800 SP2.
> > .NET Framework v1.1
> > Visual Studio .NET 2003
> > Below is the exception:
> > Server Error in '/EC315CH02' Application.
> > ----------------------
> > ----
> > Server cannot access application directory 'E:\Documents and
> > Settings\...<SubFolders>...\'. The directory does not exist or is not
> > accessible because of security settings. Description: An unhandled
> > exception occurred during the execution of the current web request.
> > Please review the stack trace for more information about the error and
> > where it originated in the code.
> > Exception Details: System.Web.HttpException: Server cannot access
> > application directory 'E:\Documents and Settings\...<SubFolders>...\'.
> > The directory does not exist or is not accessible because of security
> > settings.
> > Source Error:
> > An unhandled exception was generated during the execution of the
> > current web request. Information regarding the origin and location of
> > the exception can be identified using the exception stack trace below.
> > Stack Trace:
> > [HttpException (0x80004005): Server cannot access application
> > directory
> > 'E:\Documents and Settings\...<SubFolders>...\'. The directory does
> > not exist
> > or is not accessible because of security settings.]
> > System.Web.HttpRuntime.EnsureAccessToApplicationDi rectory() +72
> > System.Web.HttpRuntime.FirstRequestInit(HttpContex t context) +264
> > [HttpException (0x80004005): ASP.NET Initialization Error]
> > System.Web.HttpRuntime.FirstRequestInit(HttpContex t context) +990
> > System.Web.HttpRuntime.ProcessRequestInternal(Http WorkerRequest wr)
> > +128
> > ----------------------
> > ---- Version Information: Microsoft .NET Framework
> > Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
> > Does anyone know what could be the problem?
> > Can anyone provide any assistance to resolve it?
>
>

Friday, March 16, 2012

Persist object

Hello all,
I'm in need of some brainstormin help!
We have an object that we use in a number of places, both by User Controls
and Pages. This object is loaded everytime we need to use the piece of
functionality.
Example:
The user logs in and the object is loaded, the user then clicks a link to do
a task and again the object is loaded again.
What is the best way to persist the object? Session, cookie etc as it will
be used alot as the user uses the app.
Also, what are people thoughts about this, and it there any patterns that
may help?
Thanks all,
JonJon,
If it is an aspx or html page and is called with the same parameters or
without any parameters, it will be cached on the client side and will open
very fast. You will have to tell us more about the nature of the object to
hear other suggestions.
Eliyahu
"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> Hello all,
> I'm in need of some brainstormin help!
> We have an object that we use in a number of places, both by User Controls
> and Pages. This object is loaded everytime we need to use the piece of
> functionality.
> Example:
> The user logs in and the object is loaded, the user then clicks a link to
do
> a task and again the object is loaded again.
> What is the best way to persist the object? Session, cookie etc as it will
> be used alot as the user uses the app.
> Also, what are people thoughts about this, and it there any patterns that
> may help?
> Thanks all,
> Jon
Some ramblings,
if the object is loaded from server side state then I suggest making
all your pages (and controls?) extend from a base class (that you
create), this class would extend from System.web.UI.Page,
This class could load the object and set a property, which the derived
classes could access.
If the object is not to big then I'd recomend doing this each page
load, caching the object brings in added complexity,
If its a big object (or static for all users) then cache it, use the
session for user based objects and cache for static objects
In my experience though its best to load the object with each page
request
Eliyahu,
The object is data that is a collection class that we loop through to
create a tree (like Windows). This tree is not only used for navigation, but
also used in UserControls to help the user when carrying out some action,
like copying a file, specifying where to place a file etc.
The data help in the collection class rarely changes, but when we use it, we
always reload it and we were just thinking if that would be a performance
drag?
Thanks,
Jon
"Eliyahu Goldin" wrote:

> Jon,
> If it is an aspx or html page and is called with the same parameters or
> without any parameters, it will be cached on the client side and will open
> very fast. You will have to tell us more about the nature of the object to
> hear other suggestions.
> Eliyahu
> "Jon" <Jon@.discussions.microsoft.com> wrote in message
> news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> do
>
>
Jon,
If the collection is specific to a user session, the best place is the
session.
If it is application-wide, meaning it is the same for all users, a public
static variable will be good. You can also use application's Cache if you
want to be able to control the way how the object persists.
Eliyahu
"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:1BE9F76D-8B0A-4A21-B65A-54057D8E4BE7@.microsoft.com...
> Eliyahu,
> The object is data that is a collection class that we loop through to
> create a tree (like Windows). This tree is not only used for navigation,
but
> also used in UserControls to help the user when carrying out some action,
> like copying a file, specifying where to place a file etc.
> The data help in the collection class rarely changes, but when we use it,
we
> always reload it and we were just thinking if that would be a performance
> drag?
> Thanks,
> Jon
> "Eliyahu Goldin" wrote:
>
open
to
Controls
to
will
that

Persist object

Hello all,

I'm in need of some brainstormin help!

We have an object that we use in a number of places, both by User Controls
and Pages. This object is loaded everytime we need to use the piece of
functionality.

Example:

The user logs in and the object is loaded, the user then clicks a link to do
a task and again the object is loaded again.

What is the best way to persist the object? Session, cookie etc as it will
be used alot as the user uses the app.

Also, what are people thoughts about this, and it there any patterns that
may help?

Thanks all,

JonJon,

If it is an aspx or html page and is called with the same parameters or
without any parameters, it will be cached on the client side and will open
very fast. You will have to tell us more about the nature of the object to
hear other suggestions.

Eliyahu

"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> Hello all,
> I'm in need of some brainstormin help!
> We have an object that we use in a number of places, both by User Controls
> and Pages. This object is loaded everytime we need to use the piece of
> functionality.
> Example:
> The user logs in and the object is loaded, the user then clicks a link to
do
> a task and again the object is loaded again.
> What is the best way to persist the object? Session, cookie etc as it will
> be used alot as the user uses the app.
> Also, what are people thoughts about this, and it there any patterns that
> may help?
> Thanks all,
> Jon
Some ramblings,

if the object is loaded from server side state then I suggest making
all your pages (and controls?) extend from a base class (that you
create), this class would extend from System.web.UI.Page,

This class could load the object and set a property, which the derived
classes could access.

If the object is not to big then I'd recomend doing this each page
load, caching the object brings in added complexity,

If its a big object (or static for all users) then cache it, use the
session for user based objects and cache for static objects

In my experience though its best to load the object with each page
request
Eliyahu,

The object is data that is a collection class that we loop through to
create a tree (like Windows). This tree is not only used for navigation, but
also used in UserControls to help the user when carrying out some action,
like copying a file, specifying where to place a file etc.

The data help in the collection class rarely changes, but when we use it, we
always reload it and we were just thinking if that would be a performance
drag?

Thanks,

Jon

"Eliyahu Goldin" wrote:

> Jon,
> If it is an aspx or html page and is called with the same parameters or
> without any parameters, it will be cached on the client side and will open
> very fast. You will have to tell us more about the nature of the object to
> hear other suggestions.
> Eliyahu
> "Jon" <Jon@.discussions.microsoft.com> wrote in message
> news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> > Hello all,
> > I'm in need of some brainstormin help!
> > We have an object that we use in a number of places, both by User Controls
> > and Pages. This object is loaded everytime we need to use the piece of
> > functionality.
> > Example:
> > The user logs in and the object is loaded, the user then clicks a link to
> do
> > a task and again the object is loaded again.
> > What is the best way to persist the object? Session, cookie etc as it will
> > be used alot as the user uses the app.
> > Also, what are people thoughts about this, and it there any patterns that
> > may help?
> > Thanks all,
> > Jon
>
Jon,

If the collection is specific to a user session, the best place is the
session.

If it is application-wide, meaning it is the same for all users, a public
static variable will be good. You can also use application's Cache if you
want to be able to control the way how the object persists.

Eliyahu

"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:1BE9F76D-8B0A-4A21-B65A-54057D8E4BE7@.microsoft.com...
> Eliyahu,
> The object is data that is a collection class that we loop through to
> create a tree (like Windows). This tree is not only used for navigation,
but
> also used in UserControls to help the user when carrying out some action,
> like copying a file, specifying where to place a file etc.
> The data help in the collection class rarely changes, but when we use it,
we
> always reload it and we were just thinking if that would be a performance
> drag?
> Thanks,
> Jon
> "Eliyahu Goldin" wrote:
> > Jon,
> > If it is an aspx or html page and is called with the same parameters or
> > without any parameters, it will be cached on the client side and will
open
> > very fast. You will have to tell us more about the nature of the object
to
> > hear other suggestions.
> > Eliyahu
> > "Jon" <Jon@.discussions.microsoft.com> wrote in message
> > news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> > > Hello all,
> > > > I'm in need of some brainstormin help!
> > > > We have an object that we use in a number of places, both by User
Controls
> > > and Pages. This object is loaded everytime we need to use the piece of
> > > functionality.
> > > > Example:
> > > > The user logs in and the object is loaded, the user then clicks a link
to
> > do
> > > a task and again the object is loaded again.
> > > > What is the best way to persist the object? Session, cookie etc as it
will
> > > be used alot as the user uses the app.
> > > > Also, what are people thoughts about this, and it there any patterns
that
> > > may help?
> > > > Thanks all,
> > > > Jon