Click here to Skip to main content
16,020,253 members
Home / Discussions / C#
   

C#

 
QuestionHow to drag and drop datagrid cells? Pin
Kenneth Mora Flores13-Jul-06 7:34
Kenneth Mora Flores13-Jul-06 7:34 
QuestionBinding Combobox to related tables ! Pin
User 209307313-Jul-06 6:48
User 209307313-Jul-06 6:48 
QuestionHow to modified text file in C Pin
arun.m13-Jul-06 6:02
arun.m13-Jul-06 6:02 
AnswerRe: How to modified text file in C Pin
Christian Graus13-Jul-06 6:03
protectorChristian Graus13-Jul-06 6:03 
QuestionLosing value of object Pin
leckey13-Jul-06 5:54
leckey13-Jul-06 5:54 
AnswerRe: Losing value of object Pin
Christian Graus13-Jul-06 6:02
protectorChristian Graus13-Jul-06 6:02 
GeneralRe: Losing value of object Pin
leckey13-Jul-06 6:05
leckey13-Jul-06 6:05 
AnswerRe: Losing value of object Pin
Guffa13-Jul-06 9:04
Guffa13-Jul-06 9:04 
The problem is not that you can't access the variable outside the method, because you can.

The problem is that the instance of the page class where the value was, doesn't exist any more.

The instance of the page class where you stored the value in the IDOutput2 variable is used to create the page that is the response to that request. When that page has been created, the instance of the page class containing that value is released.

When the user clicks the button to go to the next page, a new instance of the page class is created to handle that request. As it is a new instance, you haven't assigned any value to the IDOutput2 variable in that instance.

The value doesn't magically reappear in the variable, just because it previously existed in a different instance of the same class.


---
b { font-weight: normal; }

GeneralRe: Losing value of object Pin
leckey13-Jul-06 9:57
leckey13-Jul-06 9:57 
AnswerRe: Losing value of object Pin
Guffa13-Jul-06 11:55
Guffa13-Jul-06 11:55 
AnswerRe: Losing value of object Pin
Josh Smith13-Jul-06 6:06
Josh Smith13-Jul-06 6:06 
GeneralRe: Losing value of object Pin
leckey13-Jul-06 6:11
leckey13-Jul-06 6:11 
GeneralRe: Losing value of object Pin
Josh Smith13-Jul-06 7:44
Josh Smith13-Jul-06 7:44 
QuestionHow to implement Trees ... Pin
JamesT113-Jul-06 5:38
JamesT113-Jul-06 5:38 
AnswerRe: How to implement Trees ... Pin
Christian Graus13-Jul-06 5:45
protectorChristian Graus13-Jul-06 5:45 
GeneralRe: How to implement Trees ... Pin
Josh Smith13-Jul-06 5:50
Josh Smith13-Jul-06 5:50 
GeneralRe: How to implement Trees ... Pin
Christian Graus13-Jul-06 5:53
protectorChristian Graus13-Jul-06 5:53 
GeneralRe: How to implement Trees ... Pin
Josh Smith13-Jul-06 5:59
Josh Smith13-Jul-06 5:59 
GeneralRe: How to implement Trees ... Pin
led mike13-Jul-06 7:28
led mike13-Jul-06 7:28 
AnswerRe: How to implement Trees ... Pin
Jun Du13-Jul-06 5:51
Jun Du13-Jul-06 5:51 
AnswerRe: How to implement Trees ... [modified] Pin
User 665813-Jul-06 5:53
User 665813-Jul-06 5:53 
AnswerRe: How to implement Trees ... Pin
BoneSoft13-Jul-06 6:13
BoneSoft13-Jul-06 6:13 
AnswerCS 101 Pin
Ennis Ray Lynch, Jr.13-Jul-06 6:22
Ennis Ray Lynch, Jr.13-Jul-06 6:22 
AnswerRe: How to implement Trees ... Pin
Eric Dahlvang13-Jul-06 7:54
Eric Dahlvang13-Jul-06 7:54 
QuestionTrying to print an html page without to load it in asp.net Pin
sai_akkina13-Jul-06 5:12
sai_akkina13-Jul-06 5:12 

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.