473,386 Members | 1,674 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.

How can keep class member properties value?

df
We all know we can keep value of server control between post-back,but
how can do this with web form class member properties?For example,I
want to decare a class member property as array,to store some info very
posting,continuely,how to do this?

Thanks for any infomation and Happy New Year!

Dec 31 '06 #1
4 2429
df wrote:
We all know we can keep value of server control between post-back,but
how can do this with web form class member properties?For example,I
want to decare a class member property as array,to store some info very
posting,continuely,how to do this?

Thanks for any infomation and Happy New Year!
Can you give more info on what your trying to store? Regardless as
always, you can throw all your stuff in the viewstate. The tradeoff is
performance.
Jan 1 '07 #2
df
Well,for example,I declare a Queue<stringRecentUploadFiles as the
class member field in .aspx.cs file,want it store recent uploaded file
infomation,one by one.

But now,every time I upload one file,this Queue has only one string,the
newest one.So,it must be re-created at every post-back,all other old
values are missed. We can see this is not what I want.Any idea?

Thank you very much,dear Joe.

On 1ÔÂ1ÈÕ, ÉÏÎç8ʱ19·Ö, "Joe (MCAD)"
<joe_c_miguel-n...@yahoo.comwrote:
df wrote:
We all know we can keep value of server control between post-back,but
how can do this with web form class member properties?For example,I
want to decare a class member property as array,to store some info very
posting,continuely,how to do this?
Thanks for any infomation and Happy New Year!Can you give more info on what your trying to store? Regardless as
always, you can throw all your stuff in the viewstate. The tradeoff is
performance.
Jan 1 '07 #3
hmmm. If I understand you correctly you probably dont want this info to
be lost when they click their back button. So, mabey this list should be
stored in a session variable?

Session["recentuploadFiles"] = x;

Joe MCAD

df wrote:
Well,for example,I declare a Queue<stringRecentUploadFiles as the
class member field in .aspx.cs file,want it store recent uploaded file
infomation,one by one.

But now,every time I upload one file,this Queue has only one string,the
newest one.So,it must be re-created at every post-back,all other old
values are missed. We can see this is not what I want.Any idea?

Thank you very much,dear Joe.

On 1ÔÂ1ÈÕ, ÉÏÎç8ʱ19·Ö, "Joe (MCAD)"
<joe_c_miguel-n...@yahoo.comwrote:
>df wrote:
>>We all know we can keep value of server control between post-back,but
how can do this with web form class member properties?For example,I
want to decare a class member property as array,to store some info very
posting,continuely,how to do this?
Thanks for any infomation and Happy New Year!Can you give more info on what your trying to store? Regardless as
always, you can throw all your stuff in the viewstate. The tradeoff is
performance.
Jan 1 '07 #4
df
No,I just want the value keeping btween post back at the same aspx
page,instead of cross-aspx page.

On 1ÔÂ1ÈÕ, ÏÂÎç12ʱ02·Ö, "Joe (MCAD)"
<joe_c_miguel-n...@yahoo.comwrote:
hmmm. If I understand you correctly you probably dont want this info to
be lost when they click their back button. So, mabey this list should be
stored in a session variable?

Session["recentuploadFiles"] = x;

Joe MCAD

df wrote:
Well,for example,I declare a Queue<stringRecentUploadFiles as the
class member field in .aspx.cs file,want it store recent uploaded file
infomation,one by one.
But now,every time I upload one file,this Queue has only one string,the
newest one.So,it must be re-created at every post-back,all other old
values are missed. We can see this is not what I want.Any idea?
Thank you very much,dear Joe.
On 1ÔÂ1ÈÕ, ÉÏÎç8ʱ19·Ö, "Joe (MCAD)"
<joe_c_miguel-n...@yahoo.comwrote:
df wrote:
We all know we can keep value of server control between post-back,but
how can do this with web form class member properties?For example,I
want to decare a class member property as array,to store some info very
posting,continuely,how to do this?
Thanks for any infomation and Happy New Year!Can you give more info on what your trying to store? Regardless as
always, you can throw all your stuff in the viewstate. The tradeoff is
performance.- Òþ²Ø±»ÒýÓÃÎÄ×Ö -- ÏÔʾÒýÓõÄÎÄ×Ö -
Jan 1 '07 #5

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

Similar topics

24
by: downwitch | last post by:
Hi, I know this has been covered here and in the .public groups, but it seems like it's been a while, especially around here, so I just thought I'd ask again to see if anyone has figured out a...
5
by: kuvpatel | last post by:
Hi I want to refer a class called LogEvent, and use one of its methods called WriteMessage without actually having to create an instance of Logevent. I have tried using the word sealed with...
14
by: Lee Franke | last post by:
I can't seem to figure this one out. Here is my class structure namespace name { public class foo { } }
11
by: Larry | last post by:
is there a way to add a class property an run-time? If so, how? any code samples? *** Sent via Developersdex http://www.developersdex.com ***
8
by: dwok | last post by:
I have been wondering this for a while now. Suppose I have a class that contains some private member variables. How should I access the variables throughout the class? Should I use properties that...
13
by: thomasp | last post by:
I have written my first Class and am posting it to this newsgroup with hopes that I can get some feedback on what is right and what is wrong with it. All comments are welcome, but more interested...
4
by: Steve Goldman | last post by:
Even asking this question probably demonstrates that I have a fundamental misunderstanding of how values and references work in C#, but here goes: I'd like to assign a reference to an arbitrary...
3
by: Simon Hart | last post by:
Hi, I am trying to implement some functionality as seen in MS CRM 3.0 whereby a basic Xml is deserialized into an object which contains properties. What I want to do from here is; cast the basic...
8
by: Per Bull Holmen | last post by:
Hey Im new to c++, so bear with me. I'm used to other OO languages, where it is possible to have class-level initialization functions, that initialize the CLASS rather than an instance of it....
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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.