This is a migrated thread and some comments may be shown as answers.

Passing value in dynamic RadPageView

1 Answer 132 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Kev
Top achievements
Rank 1
Kev asked on 06 Sep 2012, 10:09 AM
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

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 10 Sep 2012, 01:27 PM
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.
Tags
Dock
Asked by
Kev
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or