Click or drag to resize

InvalidItemFactoryExists Method

Indicates if the specified item is invalid.

Namespace:  AskiaPortalCmn
Assembly:  AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax
public static bool Exists(
	IContext context,
	InvalidItemKey key,
	string value
)

Parameters

context
Type: AskiaPortalCmnIContext
Context of execution.
key
Type: AskiaPortalCmnInvalidItemKey
Key of the item to search.
value
Type: SystemString
Value of the item to search.

Return Value

Type: Boolean
Return true if the item with the specified key/value exists.
Remarks
The existence of the item mean that it's invalid.
Examples

Validate if the user session is still valid.

var sessionKey = Request.Params["sessionKey"].ToString();
if (InvalidItemFactory.Exists(context, InvalidItemKey.Session ,sessionKey))
{
    Console.WriteLine("The session has been invalidated.");
}
else
{
    Console.WriteLine("The session is potentially valid.");
}
See Also