SectionControls/Subpages.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 System.Web.UI.WebControls;
using MyWebPagesStarterKit.Controls;
using MyWebPagesStarterKit;
using System.IO;

public partial class SectionControls_Subpages : SectionControlBaseClass
{
    private ISection _section;

    protected void Page_Load(object sender, EventArgs e)
    {
        HyperLink lnkSubpages;
        Literal ctlBreak;
        foreach (SiteMapNode node in SiteMap.CurrentNode.ChildNodes)
        {
            lnkSubpages = new HyperLink();
            lnkSubpages.Text = node.Title;
            lnkSubpages.NavigateUrl = node.Url;
            plcSubpages.Controls.Add(lnkSubpages);
            ctlBreak = new Literal();
            ctlBreak.Text = "<br />";
            plcSubpages.Controls.Add(ctlBreak);
        }
    }

    public override ISection Section
    {
        set
        {
            if (value is Subpages)
                _section = value;
            else
                throw new ArgumentException("Section must be of type Subpages");
        }
        get { return _section; }
    }

    public override bool HasAdminView
    {
        get { return false; }
    }

    public override string InfoUrl
    {
        get
        {
            string lang = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
            if (File.Exists(HttpContext.Current.Server.MapPath(string.Format("Documentation/" + lang + "/quick_guide.html"))))
            {
后面还有 7 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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