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

Get RadPageView ID

5 Answers 154 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Iron
Kjell asked on 30 Nov 2011, 03:58 PM
In your exemple TabStrip / Unique Tab Appearance.
How do i get in Page_Load / codebehind (vb) that i have click on RadPageView4 (Robertina)?

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Dec 2011, 06:56 AM
Hello,

You can access RadPageView on PageLoad by Tab's Text or Value and then access the ID.
CS:
protected void Page_Load(object sender, EventArgs e)
 {
    RadPageView pg = (RadPageView)rdtabCSD.FindTabByText("Page2").PageView;
    string pgid = pg.ID;
 }

Otherwise you can access the clicked Tab's PageView on TabClick.
CS:
protected void rdtabCSD_TabClick(object sender, RadTabStripEventArgs e)
  {
    RadTab tb= e.Tab as RadTab;
    string pgid = tb.PageView.ID;
  }

Thanks,
Princy.
0
Bozhidar
Telerik team
answered on 01 Dec 2011, 10:10 AM
Hi Kjell,

You can use the approach demonstrated here
It gets the ID of the selected RadPageView and stores it in a hidden field. The you can take this value and check it in the Page_Load event on the server side.

Regards,
Bozhidar
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
0
Genady Sergeev
Telerik team
answered on 01 Dec 2011, 10:29 AM
Hello Kjell,


Kind regards,
Genady Sergeev
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
0
Kjell
Top achievements
Rank 1
Iron
answered on 01 Dec 2011, 11:06 AM
0
Bozhidar
Telerik team
answered on 01 Dec 2011, 05:36 PM
Hello Kjell,

The method I showed you a link to doesn't rely on the tab's Text property. It takes the zero-based index of the tab in the RadTabStrip. You can then use this index to find the tab like so:

int index = Int32.Parse(hiddenField.Value);
RadTab tab = RadTabStrip1.GetAllTabs()[index];
Regards,
Bozhidar
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
TabStrip
Asked by
Kjell
Top achievements
Rank 1
Iron
Answers by
Princy
Top achievements
Rank 2
Bozhidar
Telerik team
Genady Sergeev
Telerik team
Kjell
Top achievements
Rank 1
Iron
Share this question
or