Passing value in dynamic RadPageView

2 posts, 0 answers
  1. Kev
    Kev avatar
    17 posts
    Member since:
    Feb 2011

    Posted 06 Sep 2012 Link to this post

    Hello,

    I have read the document in http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/dynamicpageview/defaultcs.aspx.

    I am building a radmultipage, with dynamic number of tabs. (The number of tabs and its title are loading from the database)

    Following the instruction, I have success to build the page. But I find I cannot pass values from the master page to the control page. Is there any method to pass some value to the user control page?

    For example, I create a dynamic multipage with 3 tabs, named "John", "David" and "Phoenix". I want one of the label in the control page have text XX's page. (i.e. When I click tab "John", it display "John's page", and when I click tab "Phoenix", it display "Phoenix's page").


    Kev
  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 10 Sep 2012 Link to this post

    Hello Kev,

    One suitable approach, for the desired scenario, is to expose the Label's text with a public property and access it from the UserControl on the OnTabClick server side event in a following manner:

    MasterPage CodeBehind :
    public string lbl_Text
          {
              get { return label.Text; }
              set { label.Text = value; }
           }
    protected void Page_Load(object sender, EventArgs e)
          {
           }

    Nested User Control with RadTabStrip:
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void OnTabClick(object sender, RadTabStripEventArgs e)
    {
        Master.lbl_Text = e.Tab.Text + "'s Page";
    }



    Greetings,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top