Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                myExtjsTab.TabPages.Clear();
                string strXmlFile = System.Web.HttpRuntime.AppDomainAppPath + "config/TabPages.xml";
                //set properties
                XmlDocument doc = new XmlDocument();
                doc.Load(strXmlFile);

                XmlNodeList pageNodes = doc.SelectNodes("Tab/TabPage");
                for (int ix = 0; ix < pageNodes.Count; ix++)
                {
                    ExtjsTabPage tabPage = new ExtjsTabPage();
                    tabPage.TabPageID = pageNodes[ix].Attributes["TabPageID"].Value;
                    tabPage.Text = pageNodes[ix].Attributes["Name"].Value;
                    tabPage.Url = pageNodes[ix].Attributes["URL"].Value;
                    string strPage = pageNodes[ix].Attributes["Pages"].Value;
                    if (!String.IsNullOrEmpty(strPage))
                    {
                        string[] pages = strPage.Split('|');
                        for (int iy = 0; iy < pages.Length; iy++)
                        {
                            if (!String.IsNullOrEmpty(pages[iy]))
                            {
                                if (pages[iy] == GetCurrentPageName())
                                {
                                    tabPage.Selected = true;
                                    break;
                                }
                            }
                        }
                    }
                    myExtjsTab.TabPages.Add(tabPage);
                }

                //build navigation
                string strCurrentPage = GetCurrentPageName();
                myNavigator.CurrentPageName = strCurrentPage;
                //switch (strCurrentPage)
                //{
                //    case "index.aspx":
                //        lblNavigation.Text = "<td><span>欢迎光临Johnny的程序员之家</span></td>";
                //        break;
                //    case "sapindex.aspx":
                //    case "saparticledetail.aspx":
                //        lblNavigation.Text = "<td><a href=\"index.html\">首页</a></td><td class=\"spacer\"><img src=\"images/c-sep.gif\"></td><td><a href=\"sapindex.html\">SAP</a></td>";
                //        break;
                //    default:
                //        lblNavigation.Text = "";
                //        break;
                //}
            }
        }
 /// <summary>
 /// Removes a specified MenuItem from the collection.
 /// </summary>
 /// <param name="item">The MenuItem instance to remove.</param>
 public void Remove(ExtjsTabPage item)
 {
     tabPages.Remove(item);
 }
 /// <summary>
 /// Returns the ordinal index of a MenuItem, if it exists; if the item does not exist,
 /// -1 is returned.
 /// </summary>
 /// <param name="item">The MenuItem to search for.</param>
 /// <returns>The ordinal position of the item in the collection.</returns>
 public virtual int IndexOf(ExtjsTabPage item)
 {
     return(tabPages.IndexOf(item));
 }
 /// <summary>
 /// Inserts a MenuItem instance at a particular location in the collection.
 /// </summary>
 /// <param name="index">The ordinal location to insert the item.</param>
 /// <param name="item">The MenuItem to insert.</param>
 public virtual void Insert(int index, ExtjsTabPage item)
 {
     tabPages.Insert(index, item);
 }
        /// <summary>
        /// Adds a MenuItem to the collection.  If the ViewState is being tracked, the
        /// MenuItem's TrackViewState() method is called and the item is set to dirty, so
        /// that we don't lose any settings made prior to the Add() call.
        /// </summary>
        /// <param name="item">The MenuItem to add to the collection</param>
        /// <returns>The ordinal position of the added item.</returns>
        public virtual int Add(ExtjsTabPage item)
        {
            int result = tabPages.Add(item);

            return(result);
        }
 /// <summary>
 /// Determines if a particular MenuItem exists within the collection.
 /// </summary>
 /// <param name="item">The MenuItem instance to check for.</param>
 /// <returns>A Boolean - true if the MenuItem is in the collection, false otherwise.</returns>
 public virtual bool Contains(ExtjsTabPage item)
 {
     return(tabPages.Contains(item));
 }
 /// <summary>
 /// Removes a specified MenuItem from the collection.
 /// </summary>
 /// <param name="item">The MenuItem instance to remove.</param>
 public void Remove(ExtjsTabPage item)
 {
     tabPages.Remove(item);
 }
 /// <summary>
 /// Inserts a MenuItem instance at a particular location in the collection.
 /// </summary>
 /// <param name="index">The ordinal location to insert the item.</param>
 /// <param name="item">The MenuItem to insert.</param>
 public virtual void Insert(int index, ExtjsTabPage item)
 {
     tabPages.Insert(index, item);
 }
 /// <summary>
 /// Returns the ordinal index of a MenuItem, if it exists; if the item does not exist,
 /// -1 is returned.
 /// </summary>
 /// <param name="item">The MenuItem to search for.</param>
 /// <returns>The ordinal position of the item in the collection.</returns>
 public virtual int IndexOf(ExtjsTabPage item)
 {
     return tabPages.IndexOf(item);
 }
 /// <summary>
 /// Determines if a particular MenuItem exists within the collection.
 /// </summary>
 /// <param name="item">The MenuItem instance to check for.</param>
 /// <returns>A Boolean - true if the MenuItem is in the collection, false otherwise.</returns>
 public virtual bool Contains(ExtjsTabPage item)
 {
     return tabPages.Contains(item);
 }
        /// <summary>
        /// Adds a MenuItem to the collection.  If the ViewState is being tracked, the
        /// MenuItem's TrackViewState() method is called and the item is set to dirty, so
        /// that we don't lose any settings made prior to the Add() call.
        /// </summary>
        /// <param name="item">The MenuItem to add to the collection</param>
        /// <returns>The ordinal position of the added item.</returns>
        public virtual int Add(ExtjsTabPage item)
        {
            int result = tabPages.Add(item);

            return result;
        }