New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Migrating From RadPanelBar ASP.NET to ASP.NET AJAX

To migrate a Web application from RadPanelBar "Classic" to RadPanelBar for ASP.NET Ajax you need to follow these steps:

  1. Make sure you have installed ASP.NET AJAX. Info can be found at http://ajax.asp.net/docs/InstallingASPNETAJAX.aspx

  2. If your web application is not using ASP.NET AJAX you need to configure it to do so. Detailed instructions can be found at http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx (Look for the topic called "Adding ASP.NET AJAX Configuration Elements to an Existing Web Site".)

  3. Add a ScriptManager control to the page (or user control) in which you want to add any RadControls "for ASP.NET Ajax": <asp:ScriptManager ID="ScriptManager1" runat="server" /> If your page is a content page you can add the ScriptManager control in your master page. For further details about the ScriptManager control, see http://ajax.asp.net/docs/overview/ScriptManagerOverview.aspx.

  4. Drag and drop a control from the RadControls for ASP.NET Ajax package or manually copy the Telerik.Web.UI.dll in the Bin folder.

  5. Replace the classic RadPanelBar directive <%@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadPanelbar.NET2" %> with the new one of RadPanelBar "for ASP.NET Ajax": <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

Differences between RadPanelBar "classic" and RadPanelBar for ASP.NET Ajax

RadPanelBar for ASP.NET AJAX contains a number of changes because of moving from the ASP.NET to the Ajax framework of the Telerik.Web.UI suite. These changes are listed below:

Server-side API changes

In the server-side API, some properties and methods have been removed and a few have changed their names. Some of the type names have changed as well. These changes are described below:

RadPanelBar

The following table lists the changes to the RadPanelBar class:

 

RadPanelBar "Classic"RadPanelBar for ASP.NET Ajax
Properties
AutoPostBackRemoved. Postback is fired as soon as a server event is wired.
ImageOverUrlRenamed to HoveredImageUrl .
PanelbarAnimationTypeRemoved. Use AnimationType instead.
PanelbarAnimationSettingsRemoved. Use AnimationSettings instead.
Methods
FindItemByClientIDRemoved.
GetAllItemsReturn type changed to IList<RadPanelItem>

Renamed Types

The following table lists the changes to the type names that RadPanelBar uses:

 

RadPanelBar "Classic"RadPanelBar for ASP.NET Ajax
RadPanelbarRenamed to RadPanelBar to comply with the naming convention of the other navigation controls.
PanelbarExpandModeRenamed to PanelBarExpandMode

XML structure changes

The XML structure of the RadPanelBar has changed:

XML
<panelitems>    
    <PanelItem Text="Products" Expanded="True" >        
        <PanelItem Text="RadEditor" />        
        <PanelItem Text="RadPanelBar" />        
        <PanelItem Text="RadMenu" />        
        <PanelItem Text="RadTabStrip" />    
    </PanelItem>    
    <PanelItem Text="Support">        
        <PanelItem Text="Knowledge Base" />        
        <PanelItem Text="Forums" />        
        <PanelItem Text="Articles" />        
        <PanelItem Text="FAQ" />    
    </PanelItem>
</panelitems>
ASPNET
<panelbar> 
<Item Text="Products" Expanded="True" >  
    <Item Text="RadEditor" />  
    <Item Text="RadPanelBar" /> 
    <Item Text="RadMenu" />  
    <Item Text="RadTabStrip" /> 
</Item> 
<Item Text="Support" >  
    <Item Text="Knowledge Base" />  
    <Item Text="Forums" />  
    <Item Text="Articles" />  
    <Item Text="FAQ" /> 
</Item>
</panelbar>

Client-side API changes

The client-side API has been changed to follow the MS AJAX naming convention. The control's client-side API is not backward-compatible with RadPanelBar Classic edition. In order to migrate from RadPanelBar "Classic", the method calls and property accessors should use the new convention. A reference table is included below.

RadPanelBar class

The following table lists the changes to the RadPanelBar client-side object:

 

RadPanelBar "Classic"RadPanelBar for ASP.NET Ajax
Methods
Disable()disable()
Enable()enable()
FindItemByID()Removed.
FindItemByUrl()findItemByUrl()
FindItemByValue()findItemByValue()
FindItemByText()findItemByText()
AttachEventuse get_events().addHandler() or add_eventName instead.
DetachEventuse get_events().removeHandler() or remove_eventName instead.
GetAttribute()use get_attributes().getAttribute()
SetAttribute()use get_attributes().setAttribute()
JavaScript
	
var panelBar = $find("<%=RadPanelBar1.ClientID%>"); 
alert(panelBar.get_attributes().getAttribute("AttributeName"));
	
JavaScript
	
var panelBar = $find("<%=RadPanelBar1.ClientID%>"); 
panelBar.get_attributes().setAttribute("AttributeName", "AttributeValue");
	
RadPanelBar "Classic"RadPanelBar for ASP.NET Ajax
Properties
IDget_id()
DomElementget_element()
Itemsget_items()
Enabledget_enabled()
AllItemsget_allItems()
ExpandedItemget_expandedItem()
SelectedItemget_selectedItem()
FocusedItemget_focusedItem()

RadPanelItem class

The following table lists the changes to the RadPanelItem client-side object:

 

RadPanelBar "Classic"RadPanelBar for ASP.NET Ajax
Methods
Disable()disable()
Enable()enable()
Focus()focus()
Blur()blur()
Select()select()
SetText()set_text()
GetText()get_text()
SetValue()set_value()
GetAttribute()use get_attributes().getAttribute() instead.
SetAttribute()use get_attributes().setAttribute() instead.
FocusPreviousItem()focusPreviousItem()
FocusNextItem()focusNextItem()
FocusFirstChild()focusFirstChild()
FocusLastChild()focusLastChild()
GetNextItem()getNextSibling()
GetPreviousItem()getPreviousSibling()
Expand()expand()
Collapse()collapse()
UnSelect()unSelect()
Properties
Enabledget_enabled(), set_enabled()
Indexget_index()
PanelBarget_panelBar()
Textget_text(), set_text()
Valueget_value(), set_value()
DomElementget_element()
Itemsget_items()
FocusedItemget_focusedItem()
ExpandedItemget_expandedItem()
Parentget_parent()
LinkElementget_linkElement()
ImageElementget_imageElement()
TextElementget_textElement()
Levelget_level()
Focusedget_focused(), set_focused()

CSS Class Names changes

The following table lists the changes to CSS classes used in RadPanelBar skins:

 

RadPanelBar "Classic"RadPanelBar for ASP.NET Ajax
disabledrpDisabled
firstrpFirst
grouprpGroup
itemrpItem
lastrpLast
levelrpLevel
linkrpLink
rootGrouprpRootGroup
selectedrpSelected
sliderpSlide
textrpText
templaterpTemplate
imagerpImage

See Also