D
dwight0
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.
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.