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); }
public string EncodePath(string sIn) { if (!(sIn.StartsWith(@"\") || sIn.StartsWith(@"/"))) { sIn = @"/" + sIn; } return(CMSConfigHelper.EncodeBase64(sIn.ToLowerInvariant())); }
protected string EncodeBase64(string input) { return(CMSConfigHelper.EncodeBase64(input)); }