public static class AsyncFileUploadExtender
{
public static void Clear(AjaxControlToolkit.AsyncFileUpload asyncFileUpload)
{
if (asyncFileUpload != null)
{
HttpContext currentContext;
if (HttpContext.Current != null && HttpContext.Current.Session != null)
{
currentContext = HttpContext.Current;
}
else
{
currentContext = null;
}
if (currentContext != null)
{
foreach (string key in currentContext.Session.Keys)
{
if (key.Contains(asyncFileUpload.ClientID))
{
currentContext.Session.Remove(key);
break;
}
}
}
}
}
}