Click here to Skip to main content
15,891,809 members
Articles / Web Development / ASP.NET

Hosting IFRAMEs using the JQuery UI Tabs plug-in - Part 1

Rate me:
Please Sign up or sign in to vote.
4.89/5 (20 votes)
23 Dec 2009CPOL9 min read 95.4K   1.9K   73  
Using JQuery UI Tabs to host web pages via IFRAMEs.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace HomeSite
{
    /// <summary>
    /// Home Site (default) web page code behind class
    /// </summary>
    public partial class _Default : System.Web.UI.Page
    {
        /// <summary>
        /// On page load we need to create the tab list items for tab interface construction
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                AddTabsToForm();
        }

        /// <summary>
        /// This method calls to our business logic class to read the tab configuration file,
        /// which will return an ArrayList of TabDefinition classes. This method iterates
        /// through the ArrayList building HTML controls to add to the tab panel.
        /// </summary>
        protected void AddTabsToForm()
        {

            foreach (TabDefinition tab in TabConfiguration.LoadConfiguration(this.Page))
            {
                HtmlGenericControl tabListItem = new HtmlGenericControl();
                tabListItem.TagName = "li";
                tabListItem.InnerHtml = "<a title=\"" + tab.DisplayName + "\" href=\"ContentLoader.aspx?ID=" + tab.ID + "&Path=" + tab.Path + "\">" + tab.DisplayName + "</a>";
                panelList.Controls.Add(tabListItem);
            }

        }

    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer Intel Corporation
United States United States
I am an Automation Engineer specializing in application and web development/support.

Comments and Discussions