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

Tab ID / Localized Value / Client-side Access

3 Answers 124 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Benjamin Millspaugh
Top achievements
Rank 1
Benjamin Millspaugh asked on 23 Apr 2008, 03:10 PM
I am trying to upgrade my TabStrips and Tabs from RadControls for ASP.NET to RadControls for ASP.NET AJAX but I am having trouble since the ID property has been removed.  I used the ID on the server side and the client side for working with the tabs since it was a unique identifier but that property has been removed in the new version and I can't find an adequate replacement since the other properties such as Text and Value are all localizable and change depending on that language you are viewing the site in.  I understand why Text is localizable, but I am not sure why Value is and if it weren't localizable I could possibly use it as a replacement for the ID property.

Can you please tell me why the ID has been removed, why Value is localizable and how I am supposed to refer to the tabs on the client side with a multi-language website?

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Apr 2008, 03:33 PM

Hello Benjamin Millspaugh,

The ID property is internally used to support the server-side control framework we have developed. It is no longer rendered to save output on the client-side. You can still make it render if you set it via the attributes collection of the tab (tab.Attributes["id"] = value).

You can also use the Value property for the sake of identifying tabs. It shouldn't be affected by the localization if you don't explicitly do so. For example you can delete the .Value entries from your resource file. We made the Value property localizable to follow the established convention (System.Web.UI.WebControls.MenuItem.Value is localizable as well).


I hope this helps,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Benjamin Millspaugh
Top achievements
Rank 1
answered on 23 Apr 2008, 04:28 PM
You can't say that the Value property isn't affected by localization since it is a localizable property and every time you generate resources for the page it will be created automatically.  Going in every time to remove it manually is not a solution, it is a hack for something that probably shouldn't have been localized in the first place.

I will look into the attributes but it sounds like they need to be set in the code behind, but of course there is no way to reference the tab on the server side in order to set the attribute because the ID property has been removed unless you build the entire tabstrip and tabs in the code behind and have no markup.

The removal of the ID property seems like a big sacrifice for saving a few characters on a page.  I am disappointed that you are not preserving the functionality of the old TabStrip or providing a solid alternate approach in the new product.
0
Atanas Korchev
Telerik team
answered on 24 Apr 2008, 08:32 AM
Hi Benjamin Millspaugh,

Localization of the Value property was made to follow the established convention - all our other controls (RadTreeView, RadMenu, RadTabStrip) and some of Microsoft's have their Value property localizable. The "classic" RadTabStrip supported the same feature as well.

By the way you can use custom attributes defined inline in your ASPX like this:
            <telerik:RadTabStrip runat="server" ID="RadTabStrip1" meta:resourcekey="RadTabStrip1Resource1">
                <Tabs>
                    <telerik:RadTab Text="Corporate" MyID="Tab1" meta:resourcekey="RadTabResource1" runat="server" Selected="True"></telerik:RadTab>
                    <telerik:RadTab Text="Products" MyID="Tab2" meta:resourcekey="RadTabResource2" runat="server"></telerik:RadTab>
                    <telerik:RadTab Text="Services" MyID="Tab3" meta:resourcekey="RadTabResource3" runat="server"></telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>

You can use the findTabByAttribute(attributeName, attributeValue) JavaScript routine to find your tabs. I hope this is a feasible workaround for you.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TabStrip
Asked by
Benjamin Millspaugh
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Benjamin Millspaugh
Top achievements
Rank 1
Share this question
or