More in this section
Forums / Developing with Sitefinity / Subpages in tabs

Subpages in tabs

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
4 posts, 0 answered
  1. MikaelK
    MikaelK avatar
    12 posts
    Registered:
    23 Jun 2010
    01 Nov 2010
    Link to this post
    Hi,

    For organizing purpose I'd like to create some subpages and render the content of those in separate tabs. I have a RadTabStrip and succesfully renders the subpage of the parent into separate RadPageViews. My problem is how to handle the events of the rendered buttons in such a setup.

    Ideas anyone?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Nov 2010
    Link to this post
    Hi MikaelK,

    You can subscribe for the button events in Page_Load, because the controls inside RadMultiPage are accessible.

    sample

    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Black" MultiPageID="RadMultiPage1"
                SelectedIndex="0" CssClass="tabStrip">
                <Tabs>
                    <telerik:RadTab Text="Tab1">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Tab2">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Tab3">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="multiPage">
                <telerik:RadPageView ID="RadPageView1" runat="server">
                <p> Some text from tab1</p>
                        <asp:Button runat="server" ID="Button1"  Text="Button1" />
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server" CssClass="pageViewEducation">
                     <p> Some text from tab2 </p>
                        <asp:Button runat="server" ID="Button2"  Text="Button2" />
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3" runat="server">
                      <p> Some text from tab3 </p>
                        <asp:Button runat="server" ID="Button3"  Text="Button3" />
                </telerik:RadPageView>
      </telerik:RadMultiPage>

    cs

    protected void Page_Load(object sender, EventArgs e)
    {
     
        this.Button1.Click += new EventHandler(Button1_Click);
        this.Button2.Click += new EventHandler(Button2_Click);
        this.Button3.Click += new EventHandler(Button3_Click);
    }
     
     
    void Button1_Click(object sender, EventArgs e)
    {
        string scriptKey = "alertMessage3";
        string scriptBlock = @"<script language=""JavaScript"">alert(""message1"");</script>";
        Page.RegisterStartupScript(scriptKey, scriptBlock);
    }
     
     
     
    void Button2_Click(object sender, EventArgs e)
    {
        string scriptKey = "alertMessage2";
        string scriptBlock =@"<script language=""JavaScript"">alert(""message2"");</script>";
        Page.RegisterStartupScript(scriptKey, scriptBlock);
    }
     
      void Button3_Click(object sender, EventArgs e)
    {
            string scriptKey = "alertMessage1";
            string scriptBlock =@"<script language=""JavaScript"">alert(""message3"");</script>";
            Page.RegisterStartupScript(scriptKey, scriptBlock);
    }


    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. MikaelK
    MikaelK avatar
    12 posts
    Registered:
    23 Jun 2010
    02 Nov 2010
    Link to this post
    Hi Ivan and thank you again for such a quick response.

    Your solution sounds logical. I will give it a try and post a follow-up on this thread later.
  4. MikaelK
    MikaelK avatar
    12 posts
    Registered:
    23 Jun 2010
    03 Nov 2010
    Link to this post
    Hi,
    A quick follow-up for those who try to accomplish the same. For the event to fire I needed to assign the events programmatically in the overriden CreateChildControls() method.Just declaring them in the.ascx wasn't enough.

    /M
Register for webinar
4 posts, 0 answered