run method once

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a class method that i like to run once in a page.. so when the page is
reloaded i don't want to method to run again.

how is this possible in C#?

Many Thanks
 
My first thought would be to check IsPostBack...

It's always best also to describe what you want to do... (for example does
"reloaded" includes having the same page loaded by someone else or by the
same person later ? Also if you tell us you are working with the cache etc
one could suggest to do that based on the presence/absence of this entry in
the cache etc...)

Patrice
 
Patrice thanks for your answer.. i have method which check if files exist in
a folder.. i just need to do the checking once thats all.
 
Back
Top