473,386 Members | 1,785 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,386 software developers and data experts.

run method once

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
Jul 21 '05 #1
2 1218
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

--

"huzz" <hu**@discussions.microsoft.com> a écrit dans le message de
news:53**********************************@microsof t.com...
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

Jul 21 '05 #2
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.

"Patrice" wrote:
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

--

"huzz" <hu**@discussions.microsoft.com> a écrit dans le message de
news:53**********************************@microsof t.com...
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


Jul 21 '05 #3

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

Similar topics

17
by: Medi Montaseri | last post by:
Hi, Given a collection of similar but not exact entities (or products) Toyota, Ford, Buick, etc; I am contemplating using the Abstraction pattern to provide a common interface to these products....
6
by: Martin | last post by:
I'd like to be able to get the name of an object instance from within a call to a method of that same object. Is this at all possible? The example below works by passing in the name of the object...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
2
by: David Morris | last post by:
Hi I want to add multiple items (about 20) to a checked list box control at run time, but do not know how to use the AddRange method of the Items collection. Currently, I am using the Add method,...
3
by: Bruce Wood | last post by:
Maybe I'm going nuts, but I was so sure that adding the same method more than once to a delegate would result in only one entry on the delegate's call list: this.UpdateEnd += new...
5
by: Earl | last post by:
I need to call a method on an owned child form, and am wondering if the best way of doing this is to capture the Closing event of the form that passes control back to the form where I have the...
9
by: Doug | last post by:
Hi I have a method that I would like to return the value to the calling event. I have a bad example below that doesnt give me what I want. What I want is to have a my readxml mthod return the...
8
by: David Veeneman | last post by:
Should a member variable be passed to a private method in the same class as a method argument, or should the method simply call the member variable? For years, I have passed member variables to...
2
by: ME | last post by:
How would one obtain the parameter VALUES of a method that has already run? I can find the method using the StackTrace and StackFrame classes but once I find the method I would like to obtain the...
0
ADezii
by: ADezii | last post by:
In last week's Tip, I showed you how to use the ISAMStats Method of the DBEngine (DAO) to return vital statistics concerning Query executions such as: Disk Reads and Writes, Cache Reads and Writes,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.