AjaxControlToolkit.PersistentStoreManager.AddFileToSession C# (CSharp) Метод

AddFileToSession() публичный Метод

public AddFileToSession ( string controlId, string filename, System.Web.HttpPostedFile fileUpload ) : void
controlId string
filename string
fileUpload System.Web.HttpPostedFile
Результат void
        public void AddFileToSession(string controlId, string filename, HttpPostedFile fileUpload)
        {
            if(fileUpload == null)
                throw new ArgumentNullException("fileUpload");

            if(String.IsNullOrEmpty(controlId))
                throw new ArgumentException("controlId cannot be empty", "controlId");

            var currentContext = GetCurrentContext();
            if(currentContext == null)
                return;

            var mode = currentContext.Session.Mode;
            if(mode != SessionStateMode.InProc)
                throw new InvalidOperationException("The AsyncFileUpload control only supports session state mode \"InProc\" when persisting files in session.");

            currentContext.Session.Add(GetFullID(controlId), fileUpload);
        }