Beispiel #1
0
        public static Purpose GetViewStatePurpose(string targetPagePath, string IISAppInPath, string viewStateUserKey)
        {
            Purpose objPurpose        = Purpose.WebForms_HiddenFieldPageStatePersister_ClientState;
            string  newTargetPagePath = simulateTemplateSourceDirectory(targetPagePath);

            newTargetPagePath = newTargetPagePath == null ? "/" : newTargetPagePath;
            List <string> specificPurposes = new List <string>()
            {
                "TemplateSourceDirectory: " + newTargetPagePath.ToUpperInvariant(),
                "Type: " + simulateGetTypeName(targetPagePath, IISAppInPath).ToUpperInvariant()
            };

            if (!string.IsNullOrEmpty(viewStateUserKey))
            {
                specificPurposes.Add("ViewStateUserKey: " + viewStateUserKey);
            }
            return(objPurpose.AppendSpecificPurposes(specificPurposes));
        }