Ejemplo n.º 1
0
        protected HtmlHelper <ResetPasswordInfo> InitHelp()
        {
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(ResetPasswordInfoSettings));
            string        sXML          = String.Empty;

            using (StringWriter stringWriter = new StringWriter()) {
                xmlSerializer.Serialize(stringWriter, _settings);
                sXML = stringWriter.ToString();
                sXML = CMSConfigHelper.EncodeBase64(sXML);
            }

            _model.Settings        = _settings;
            _model.EncodedSettings = sXML;

            var hlp = new HtmlHelper <ResetPasswordInfo>(_helper.ViewContext, new WrapperForHtmlHelper <ResetPasswordInfo>(_model, _helper.ViewData));

            string frmTag = Environment.NewLine
                            + hlp.AntiForgeryToken().ToString()
                            + Environment.NewLine
                            + hlp.HiddenFor(x => x.EncodedSettings).ToString()
                            + Environment.NewLine;

            _helper.ViewContext.Writer.Write(frmTag);

            return(hlp);
        }
Ejemplo n.º 2
0
 public string EncodePath(string sIn)
 {
     if (!(sIn.StartsWith(@"\") || sIn.StartsWith(@"/")))
     {
         sIn = @"/" + sIn;
     }
     return(CMSConfigHelper.EncodeBase64(sIn.ToLowerInvariant()));
 }
Ejemplo n.º 3
0
 protected string EncodeBase64(string input)
 {
     return(CMSConfigHelper.EncodeBase64(input));
 }