SectionControls/HtmlContent.ascx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

//===============================================================================================
//
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.
//
//===============================================================================================

using System;
using System.Web;
using MyWebPagesStarterKit.Controls;
using MyWebPagesStarterKit;
using System.IO;
using System.Web.SessionState;

public partial class SectionControls_HtmlContent : SectionControlBaseClass
{
    private HtmlContent _section;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            btnSave.Text = Resources.StringsRes.glb__Save;

            //Set the Default Langauge for the FCKEditor
            string lang = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
            FCKeditor1.DefaultLanguage = lang;
        }
    }

    protected void Page_PreRender(object sender, EventArgs e)
    {
        updateViews();
    }

    protected void btnSave_Click(object sender, EventArgs e)
    {
        /// if there is a new image uploaded, the placeholder [XXX] needs to be replaced by the pageID
        /// -> to enforce a secure download of the image with authentication of the user
        string pageId = Request.QueryString["pg"];

        _section.Html = FCKeditor1.Value.Replace("[XXX]", pageId);
        _section.SaveData();
    }

    protected void btnCancel_Click(object sender, EventArgs e)
    {
        
    }

    public override ISection Section
    {
        set
        {
            if (value is HtmlContent)
                _section = (HtmlContent)value;
            else
                throw new ArgumentException("Section must be of type HtmlContent");
后面还有 38 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。