Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 25, 2010 @ 16:08
    Jeroen Breuer
    0

    Umbraco tabs

    Hello,

    I'm creating my own custom section and inside this custom sectiom I'm creating a page which has multiple tabs. To create an Umbraco tab I need to use the TabView and TabPage webcontrols. I've looked into the Umbraco source code, but every time a control is added it's done the following way:

    protected umbraco.uicontrols.TabView tbv = new umbraco.uicontrols.TabView();

     

    uicontrols.

    TabPage tp = tbv.NewTabPage(ui.Text("content"));

    tp.HasMenu =

    false;

    tp.Controls.Add(

    new LiteralControl("<iframe frameborder=\"0\" src=\"../TreeInit.aspx?app=content&amp;isDialog=true&amp;contextMenu=false\" style=\"LEFT: 0px; OVERFLOW: auto; WIDTH: 280px; POSITION: relative; TOP: 0px; HEIGHT: 220px; BACKGROUND-COLOR: white; border: none\"></iframe>"));

    The controls are always added using C# code. Is there a way to do this on an .aspx page? I'd like to create my webcontrols and html on the .aspx page instead of needing to code everyting in C# (where it's not supposed to be...).

    The following code is an example how I'd like to have it:

    <%

    @ Register TagPrefix="UmbracoControls" Namespace="umbraco.uicontrols" Assembly="controls" %>

    <

     

    UmbracoControls:TabView ID="TabView1" runat="server">

     

    <UmbracoControls:TabPage ID="TabPage1" runat="server" Text="Tab1">

    My webcontrols for tab1.

     

    </UmbracoControls:TabPage>

     

    <UmbracoControls:TabPage ID="TabPage2" runat="server" Text="Tab2">

    My webcontrols for tab2.

     

    </UmbracoControls:TabPage>

    </

     

    UmbracoControls:TabView>

    Is it possible to use the Umbraco tabs this way and if not is there another good solution in which I don't need to programm my webcontrols inside C# code?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 25, 2010 @ 16:19
    Jeroen Breuer
    1

    Already found the solution in one of Tim Geyssens his example projects:

    Frontent:

    <%

    @ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>

    <cc1:TabView runat="server" ID="tabControl" Width="552px" Height="692px"/>

     

    <cc1:Pane ID="Pane1" runat="server" Height="600px" Width="330px">

     

    <cc1:PropertyPanel runat="server" ID="pp_sample1">

     

    <asp:Literal ID="litsample1" runat="server"></asp:Literal>

     

    </cc1:PropertyPanel>

     

    </cc1:Pane>

     

     

    <cc1:Pane ID="Pane2" runat="server" Height="600px" Width="330px">

     

    <cc1:PropertyPanel runat="server" ID="pp_sample2">

     

    <asp:Literal ID="litsample2" runat="server"></asp:Literal>

     

    </cc1:PropertyPanel>

     

    </cc1:Pane>

     

    Backend:

    FirstTab = tabControl.NewTabPage(

    "First");

    FirstTab.Controls.Add(Pane1);

     

    SecondTab = tabControl.NewTabPage(

    "Second");

    SecondTab.Controls.Add(Pane2);

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 25, 2010 @ 19:43
    Jeroen Breuer
    0

    Hello,

    I've got a new problem. Currently I use the example found at http://www.nibble.be/?p=71 and it works great except one thing. I'm trying to use the example in combination with ajax, but somehow after a postback the page disapears.

    Before postback: http://img707.imageshack.us/i/section1.jpg/

    After postback: http://img251.imageshack.us/i/section2.jpg/

    This probably got something to do with the following code in the page_init:

    protected

     

    override void OnInit(EventArgs e)

    {

     

    //Add the tabs to the tabview.

    ManagementTab = TabViewDetails.NewTabPage(

    "Beheer");

    ManagementTab.Controls.Add(Image1Pane);

    ManagementTab.Controls.Add(Image2Pane);

    ManagementTab.Controls.Add(Image3Pane);

    ManagementTab.Controls.Add(Image4Pane);

    DataTab = TabViewDetails.NewTabPage(

    "Gegevens");

    DataTab.Controls.Add(DataPane);

     

    //Create a save button.

     

    ImageButton save = ManagementTab.Menu.NewImageButton();

    save.Click +=

    new ImageClickEventHandler(ManagementTabSave_Click);

    save.AlternateText =

    "Save";

    save.ImageUrl =

    GlobalSettings.Path + "/images/editor/save.gif";

    }

    How can I make this work with ajax?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 26, 2010 @ 09:46
    Jeroen Breuer
    0

    Doesn't anybody know how I can use Umbraco tabs in combination with ajax?

Please Sign in or register to post replies

Write your reply to:

Draft