Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
GeneralRe: Processing strings in C# Pin
DEWright_CA24-May-05 11:27
DEWright_CA24-May-05 11:27 
GeneralRe: Processing strings in C# Pin
Christian Graus24-May-05 11:38
protectorChristian Graus24-May-05 11:38 
GeneralRe: Processing strings in C# Pin
DavidNohejl24-May-05 11:39
DavidNohejl24-May-05 11:39 
GeneralCapturing a Window Handle Pin
Anonymous24-May-05 10:27
Anonymous24-May-05 10:27 
GeneralRe: Capturing a Window Handle Pin
Dave Kreskowiak24-May-05 11:09
mveDave Kreskowiak24-May-05 11:09 
GeneralRe: Capturing a Window Handle Pin
Akrynite24-May-05 11:41
Akrynite24-May-05 11:41 
GeneralRe: Capturing a Window Handle Pin
User 665824-May-05 11:51
User 665824-May-05 11:51 
GeneralRe: Capturing a Window Handle Pin
Dave Kreskowiak24-May-05 14:38
mveDave Kreskowiak24-May-05 14:38 
GeneralRe: Capturing a Window Handle Pin
eggie524-May-05 12:37
eggie524-May-05 12:37 
GeneralArchitecture Issue Pin
parrot12324-May-05 9:30
parrot12324-May-05 9:30 
GeneralRe: Architecture Issue Pin
Marc Clifton24-May-05 11:59
mvaMarc Clifton24-May-05 11:59 
GeneralRe: Architecture Issue Pin
Anonymous24-May-05 19:24
Anonymous24-May-05 19:24 
GeneralRe: Architecture Issue Pin
Marc Clifton25-May-05 0:20
mvaMarc Clifton25-May-05 0:20 
GeneralDebugging SEHExceptions Pin
Luis Alonso Ramos24-May-05 8:51
Luis Alonso Ramos24-May-05 8:51 
QuestionDefault Enter and Cancel button C# Winforms? Pin
pankazmittal24-May-05 8:25
pankazmittal24-May-05 8:25 
AnswerRe: Default Enter and Cancel button C# Winforms? Pin
Uri Lavi24-May-05 8:38
Uri Lavi24-May-05 8:38 
AnswerRe: Default Enter and Cancel button C# Winforms? Pin
pubududilena24-May-05 21:33
pubududilena24-May-05 21:33 
GeneralRe: Default Enter and Cancel button C# Winforms? Pin
pankazmittal25-May-05 4:11
pankazmittal25-May-05 4:11 
GeneralRetives all databases names ,tables names and Columsn names of local host Pin
ksanju100024-May-05 7:15
ksanju100024-May-05 7:15 
GeneralRe: Retives all databases names ,tables names and Columsn names of local host Pin
rudy.net24-May-05 17:58
rudy.net24-May-05 17:58 
GeneralRe: Retives all databases names ,tables names and Columsn names of local host Pin
ksanju100024-May-05 18:52
ksanju100024-May-05 18:52 
GeneralRe: Retives all databases names ,tables names and Columsn names of local host Pin
pubududilena24-May-05 22:22
pubududilena24-May-05 22:22 
GeneralRe: Retives all databases names ,tables names and Columsn names of local host Pin
ksanju100024-May-05 22:49
ksanju100024-May-05 22:49 
GeneralRe: Retives all databases names ,tables names and Columsn names of local host Pin
rudy.net25-May-05 2:48
rudy.net25-May-05 2:48 
GeneralPage-level static members and Events Pin
DisruptedSinner24-May-05 7:05
DisruptedSinner24-May-05 7:05 
Reposting: I got no response in ASP.Net forum.

Hello everyone,

I have a question on using code-behind page-level static class members to preserve page-level data during click events and/or page refreshes. For example, if I have something like:
<code>
public class MyPage : System.Web.UI.Page
{
	private static MyDataObject m_data;

	private void Page_Load(object sender, System.EventArgs e)
	{
		if( !IsPostBack )
			m_data = LoadMyData();
	}

	private void SaveButton_Click(object sender, System.EventArgs e)
	{
		// Save my m_data.
	}
}</code>



I'm hoping that when the user clicks to some other page on my website that this m_data object will be released from memory. And, I'm also hoping that if I have many people accessing this page at the same time, that each page will have its own m_data object created so that each user sees their properly loaded data.

Am I going about this wrong? Is there a better way? I've heard that page-level caching does not scale well in web farms, etc., so I'm trying to avoid that type of solution.

Thanks in advance,
~Brad Smile | :)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.