Tuesday 15 September 2015

State in ASP.net Master Page -


We have a bug that we are trying to fix. It seems that a user can see the same ASPX page at the same time to other users.

I was thinking: If we store data in a property on the master page, then all pages will run at the same time viewing that data.

is a master page:

  public class MyMasterBase: System.Web.UI.MasterPage {Private int myInt; }  

Create references for the master page from aspx pages:

  MyMasterBase Master = Page. Masters as MyMasterBase;  

Two users then call the ASPX page at the same time:

  • The first user sets 1 to myInt
  • Second user
  • What will happen if the first user reads my INR value?

I hope it will be 1, but if it was 2 then

Shiraz

I like the cash problem Do not continue data between master page sessions, but cache will search everywhere in your project that you are entering information in the cache and make sure no user or session-specific data is going into it. The cache should contain only information that is applicable to all users at any time.


No comments:

Post a Comment