MarkItUp.SingleUserBlog.Web/CatalogDialog.aspx

(开头部分) 4KB

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

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Xml" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    
    XmlDocument _doc = new XmlDocument();


    protected string SelectedCatalog {
        get {
            return (ViewState["SelectedCatalog"] == null) ?
                "" : ViewState["SelectedCatalog"].ToString();
        }
        set {
            ViewState["SelectedCatalog"] = value;
        }
    }
    
    
    protected override void OnInit(EventArgs e) {
        base.OnInit(e);

        if (Request.QueryString["postbackReference"] != null) {
            this.hdnPostBackReference.Value =
                Request.QueryString["postbackReference"].ToString();
        }


        string xmlFilePath = Server.MapPath("~/App_Data/CatalogData.xml");
        _doc.Load(xmlFilePath);
        
        
        if (!IsPostBack) {
            BindCatalog();
            BindWebParts();
        }
    }


    void BindCatalog() {

        this.rptCatalogs.DataSource = _doc.DocumentElement.ChildNodes;
        this.rptCatalogs.DataBind();
        
    }

    void BindWebParts() {

        XmlNodeList nodes = null ;
        
        if (string.IsNullOrEmpty(this.SelectedCatalog)) {
            nodes = _doc.DocumentElement.ChildNodes[0].ChildNodes;
        } else {
            XmlNode node = _doc.DocumentElement.SelectSingleNode("//catalog[@displayName='" + this.SelectedCatalog + "']");
            if (node != null)
                nodes = node.ChildNodes;
        }

后面还有 75 行代码,解锁后查看完整代码

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

AI 解读

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

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