Click here to Skip to main content
15,905,776 members
Home / Discussions / C#
   

C#

 
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 | :)
GeneralRe: Page-level static members and Events Pin
S. Senthil Kumar24-May-05 7:49
S. Senthil Kumar24-May-05 7:49 
GeneralRe: Page-level static members and Events Pin
DisruptedSinner24-May-05 8:16
DisruptedSinner24-May-05 8:16 
GeneralRe: Page-level static members and Events Pin
Luis Alonso Ramos24-May-05 9:08
Luis Alonso Ramos24-May-05 9:08 
GeneralRe: Page-level static members and Events Pin
DisruptedSinner24-May-05 9:20
DisruptedSinner24-May-05 9:20 
GeneralTImed Form Pin
fadeddata24-May-05 6:48
fadeddata24-May-05 6:48 
GeneralRe: TImed Form Pin
fadeddata24-May-05 6:50
fadeddata24-May-05 6:50 
GeneralRe: TImed Form Pin
S. Senthil Kumar24-May-05 7:46
S. Senthil Kumar24-May-05 7:46 
GeneralRe: TImed Form Pin
Luis Alonso Ramos24-May-05 11:14
Luis Alonso Ramos24-May-05 11:14 
Generaldocument variables Pin
merlinos24-May-05 6:15
merlinos24-May-05 6:15 
QuestionHow we can pass a string variable to matlab Pin
hediii24-May-05 5:43
hediii24-May-05 5:43 
AnswerRe: How we can pass a string variable to matlab Pin
eggie524-May-05 12:42
eggie524-May-05 12:42 
AnswerRe: How we can pass a string variable to matlab Pin
hediii25-May-05 21:59
hediii25-May-05 21:59 
GeneralOPSEC SDK Pin
NitinR24-May-05 4:54
NitinR24-May-05 4:54 
GeneralRe: OPSEC SDK Pin
Judah Gabriel Himango25-May-05 4:18
sponsorJudah Gabriel Himango25-May-05 4:18 
Generalchange number color to 128 on a tif image Pin
kyfranBibax24-May-05 4:01
kyfranBibax24-May-05 4:01 
GeneralRe: change number color to 128 on a tif image Pin
kyfranBibax25-May-05 2:00
kyfranBibax25-May-05 2:00 
GeneralWMI Win32_PrintJob and windows service Pin
Member 198883924-May-05 3:58
Member 198883924-May-05 3:58 

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.