Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //For correcting xml files
            string attribute  = "id";
            string descendant = "Product";

            //Load XMLs
            _xDocument = XDocument.Load(appDomain + xmlsFolder + listXmlFileName);

            //if dublicate ids, correct and save new XML
            _xDocument.CorrectElementAttribute(attribute, descendant, CorrectedListXmlFileName, NEWID);

            //Load Detail.xml
            _xDocument = XDocument.Load(appDomain + xmlsFolder + detailXmlFileName);

            //if dublicate ids, correct and save new XML
            _xDocument.CorrectElementAttribute(attribute, descendant, CorrectedDetailXmlFileName, NEWID);


            if (!Page.IsPostBack)
            {
                Repeater1.DataSource = GetProductListData();
                Repeater1.DataBind();
            }

            //Add client-side attribute to DDLSortProducts for sorting products in ListView.aspx
            DDLSortProducts.Attributes.Add("onchange", "return SortProducts();");
        }