Sunday 27 May 2012

ClientFormsIdentity

<Namespace>
System.web.ClientServices

<Constructors>
<Properties>
AuthenicationCookies: Gets a collection of the cookies retrieved from the authenication service
IsAuthencated: Gets a value indicating whether the user has been authenticated

<Methods>
RevalidateUser: Silently authenticates the user by using cached credentials.

<the namespace System.Web.ClientServices>
The System.Web.ClientServices namespace provides classes that support acess in Windowes-based application to the ASP.NET Ajax authentication, roles, and profiles services.

The ConnectivitySatus class enables you to store the status of the user's network connection in the lcoal data cache. The connectivity status indicates whether the client service providers will use the offline cache or attempt to acess the application services.


A code project ariticle talks about 'Client Application Services' in visual studio 2008.



Sunday 6 May 2012

Cache

Namespace: System.Web.Caching

<Properties>
Count: Gets the number of items stored in the cache
EffectivePercentagePhysicalMemoryLimit:
Item: Gets or sets the cache item at the specified key

<Methods>
Add: adds the specified item to the Cache object with dependencies, expiration and priority policies
Get: retrieves the specified item from the Cache object
GetHashCode: Serves as a hash function for a particular type.
Insert(String, Object): inserts an item into the Cache object with a cache key




To use the CacheItemRemovedCallback delegate, you must add an item to the cache with this method, so that ASP.NET can automatically make the proper method calls when the item is removed. (look at red under line in above picture).

<Cache vs Session Variables>


Cache is application specific and Session is user specific.
eg. If you have a cache object say Cache["abc"], then this value is available to all the user logged in to the site.
Cache["abc"]= "website cache";
User A reads its value as "website cache"
User B reads its value as "website cache"
But if you have session variable, then each user has its own copy of Session.
eg. User A --> Session["UserName"]= "Mr. XYZ";
User B --> Session["UserName"]="Mr. ABC"; 

AuthenticationService Class

Enables access to ASP.NET forms authentication as a web service.

The AuthenticationService type exposes the following members
<Methods>
IsLoggedIn: Determines whether the current user is authenticated.
Login: Checks user credentials and creates an authentication ticket (cookie) if he credentials are valid
ValidateUser: Autheiticate user credentials without issuing an authentication ticket.

<Events>
Authenticating: occurs when user credentials are being validated
CreatingCookie: occurs when the authentication cookie is being set