Updating an asp.net page from an asynchronous WCF duplex call area - object - ASP.NET

I have the following doubts. I have a "MyPage" page, and I declared several dictionary objects in the page class.

My doubt is

  • If I declare the dictionary as a private non-static object, I cannot use it through functions in this page class (the object becomes null).
  • But if I declare the dictionary static, I can traverse the object through functions. But will this object be the same for all users who have opened the page right now (guessing that each user will have an instance of the page, in turn, has an instance for the page class, and the static class variables are immutable in all instances of the class)

As far as I understand? How to declare an object accessible for all functions of the page class and unique for each page instance (user).

Update1

Okie, I found that the initialization of the dictionary object in the page class is done in another thread (Duplex WCF callback). But in the main page theme, the dictionary object is still zero (uninitialized). Any ideas?

Update2

Marshalling - useful by accident?

Update3

In response, John -

. , , - WCF ( ) asp.net. ? . , , () ( asp.net)?

0
4

.

, . . , . . , .


, ASP.NET!

, , , , . - , . .

, , -, , . , , ! .

, , . Windows - . Ajax -, , , .


, , , ASP.NET, .

Windows. Windows WCF, ASP.NET. WCF , , , ..

- , - . - WCF, , - . - , WCF "-" ASP.NET(, , , AJAX).

. . , - , , . , , , , , , .

+1

. , , , , ( , ).

, ( ) . , , , . - (, ) , ( ViewState ).

+1

, , - , :)

  • " " - / ,

  • "", " " . .

  • " ", " ". .

, :

  • ViewState, " " .

  • , " " .

  • , " " , " ", . (v.similar to session - ASP.NET).

- :)

+1

You are correct that the static member will be the same for all instances of the page and therefore for all individual users. You need to make it a non-stationary member if you want to access it from every method in the class. You should see why the object is null. Are you creating it right at the right time?

0
source

All Articles