473,396 Members | 1,987 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.

Common methods / best practices

I have an ASP.net application where most pages have the same dropdown
menu with a list of usernames to select from. The dropdown menu is
filled from a cache as long as the cache hasnt expired and if the cache
has expired after 15 minutes, the cache object gets filled again from a
database. I do this just to keep the list up to date but also to keep
the database from being queried several times a second. Currently i
just pasted the code for do this on every page. Where/how would be the
best central place to put this in ASP.net? I was thinking of making a
static class to do this and i put a single line on each page to call a
method in that static class. Also as an alternative, I wondered if it
was possible and a good idea to make another page thats only purpose is
to update this and some other cache objects. Could i use Server.Execute
call this page, to fill the variables? I would prefer to keep it as a
page isntead of a static class because it makes it easier for others
who use the VS IDE (instead of write the code by hand) to easily
manipluate the controls / properties on the page in the case i wasnt
available to work on the project.

Nov 19 '05 #1
2 949
why not just place the dropdown list inside a user control which can be
shared amongst all pages....

--
MY ASP.Net tutorials
http://www.openmymind.net/
"dwight0" <dw*******@yahoo.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
I have an ASP.net application where most pages have the same dropdown
menu with a list of usernames to select from. The dropdown menu is
filled from a cache as long as the cache hasnt expired and if the cache
has expired after 15 minutes, the cache object gets filled again from a
database. I do this just to keep the list up to date but also to keep
the database from being queried several times a second. Currently i
just pasted the code for do this on every page. Where/how would be the
best central place to put this in ASP.net? I was thinking of making a
static class to do this and i put a single line on each page to call a
method in that static class. Also as an alternative, I wondered if it
was possible and a good idea to make another page thats only purpose is
to update this and some other cache objects. Could i use Server.Execute
call this page, to fill the variables? I would prefer to keep it as a
page isntead of a static class because it makes it easier for others
who use the VS IDE (instead of write the code by hand) to easily
manipluate the controls / properties on the page in the case i wasnt
available to work on the project.

Nov 19 '05 #2
Such a simple answer. Great idea! Thanks!

Nov 19 '05 #3

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

Similar topics

2
by: Epson Barnett | last post by:
Hi, What techniques are other people using for common code libraries? I have some classes I've written that will be useful in all my projects. I'd like to have one copy of these common classes...
6
by: Don Wash | last post by:
Hi All! I'm developing ASP.NET pages using VB.NET language. My background is VB6 and ASP3. Right now, I'm evaluating strategies on creating reusable and common functions and methods for ASP.NET....
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
5
by: wrecker | last post by:
Hi all, I have a few common methods that I need to use at different points in my web application. I'm wondering where the best place would be to put these? I think that I have three options. ...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
2
by: Phillip | last post by:
In order to maintain consistency thru a project. Our development team is getting ready to start a new project in converting all the foxpro apps to VB/SQL Server. We don't have the luxury of...
15
by: dn | last post by:
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a business layer, a data access layer, and a SQL Server 2005 database, and I have a question. In the business and data...
4
by: Ranginald | last post by:
Hi, I am generally new to OOP and in learning and writing code I have developed many of my own reusable methods. A. What is the best way to store these methods for easy reuse later? I was...
13
by: vizcayno | last post by:
Hello: Need your help in the "correct" definition of the next function. If necessary, I would like to know about a web site or documentation that tells me about best practices in defining...
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
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
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
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
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,...

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.