Exemple #1
0
        public static RouteValueDictionary EncryptRouteValueDictionary(this IEncryptString encrypter, RouteValueDictionary routeValues)
        {
            string encryptedParameters  = encrypter.Encrypt(routeValues.ToQueryString());
            RouteValueDictionary result = new RouteValueDictionary();

            result.Add("q", encryptedParameters);

            return(result);
        }
        static StringEncrypter()
        {
            UrlEncrypter = new ConfigurationBasedStringEncrypter();

            ControlsEncrypter = new SessionBasedStringEncrypter();

            //string EncrypterClassName = ConfigurationManager.AppSettings["StringEncrypter"].ToString();
            //if (string.IsNullOrEmpty(EncrypterClassName))
            //    throw new InvalidOperationException("[StringEncrypter] appSettings key is not defined or has no value.");
            //Type type = Type.GetType(EncrypterClassName);
            //UrlEncrypter = (IEncryptString)Activator.CreateInstance(type);
        }
Exemple #3
0
 static StringEncrypter()
 {
     UrlEncrypter = new ConfigurationBasedStringEncrypter();
 }
Exemple #4
0
        public static RouteValueDictionary EncryptObject(this IEncryptString encrypter, object routeValues)
        {
            RouteValueDictionary parameters = HtmlHelper.AnonymousObjectToHtmlAttributes(routeValues);

            return(encrypter.EncryptRouteValueDictionary(parameters));
        }