Esempio n. 1
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        AssertInternalReferrer();
        string output = "";

        try
        {
            string sHtml;
            sHtml = Request["html"];
            if (sHtml == null)
            {
                throw (new ArgumentException("Argument \'html\' is required."));
            }

            Ektron.Cms.Content.EkContent objEkContent = new Ektron.Cms.Content.EkContent(this.GetCommonApi().RequestInformationRef);

            output = objEkContent.ConvertHtmlContenttoXHTML(sHtml);

        }
        catch (Exception ex)
        {
            output = string.Format("<html><head><title>ekAjaxTidy Error</title></head><body class=\"ekAjaxTidyError\">{0}</body></html>", EkFunctions.HtmlEncode(ex.Message));
        }

        Response.ContentType = "application/xml";
        Response.ContentEncoding = System.Text.Encoding.UTF8; // Safari does not encode properly even though this is set
        litContent.Text = output;
    }