Codebehind calling a webpage
I have a webpage that is written to do garbage collection in my database, with the idea I could set it up to execute daily with my hosting provider to clean the database. After buiding the site I found my hosting provider was no longer providing the service to execute pages on a timed basis.
So I though if I can call the page in the codebehind of the regular webpages it will keep the database clean, and will be fast as long as the db is scrubbed frequently. I have been searching but have not found a way to execute the page from the codebehind except through trickery like doing a redirect to the db cleaner page, passing it the final url as a parameter and after cleaning is done, it redirects to the final page(could also use transfer). There must be a cleaner way(no pun intended) to do this. Any thoughs and ideas are appreciated.
Thanks in advance :)
[886 byte] By [
Nemo99] at [2007-11-18 19:17:15]

# 1 Re: Codebehind calling a webpage
Functions like this should NOT be in a web page. They should be in a distinct class that is independant of the paging.
Code on pages (including the code-behind) should be kept as minimal as possible. As a general rule if a line of code does not directly interact with the page or a control on the page, it probably should not be in the page!