<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="BrowserBar._Default" %>

<%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %>
<%@ Register Assembly="RadToolbar.Net2" Namespace="Telerik.WebControls" TagPrefix="radTlb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>

    <script type="text/javascript">
    //<!--
        function click_handler(sender, e)
        {
                var combo = <%=((RadComboBox)((Control)RadToolbar1.Items.TemplatedButtons[0]).FindControl("RadComboBox1")).ClientID%>; 
                var text = combo.GetText(); 
                var item = combo.FindItemByText(text);
                
                if (item.Index == combo.Items.length - 1)
                {            
                   <%= RadToolbar1.ClientID %>.DisableButton("Forward"); 
                } 
                else
                {
                    <%= RadToolbar1.ClientID %>.EnableButton("Forward");
                }

                if (item.Index == 0)
                {            
                   <%= RadToolbar1.ClientID %>.DisableButton("Back"); 
                } 
                else
                {
                    <%= RadToolbar1.ClientID %>.EnableButton("Back");
                }                
        }
              

    //-->
    </script>
    
    <form id="form1" runat="server">
        <div>
            <radTlb:RadToolbar ID="RadToolbar1" runat="server" OnOnClick="RadToolbar1_OnClick"
                AutoPostBack="True" Skin="winAmpModern" UseFadeEffect="True">
                <Items>
                    <radTlb:RadToolbarButton ID="RadToolbarButton1" runat="server" ButtonImage="Back.gif"
                        ButtonText="Back" CommandName="Back" Hidden="False" />
                    <radTlb:RadToolbarButton ID="RadToolbarButton2" runat="server" ButtonImage="Forward.gif"
                        ButtonText="Forward" CommandName="Forward" Hidden="False" />
                    <radTlb:RadToolbarButton ID="RadToolbarButton3" runat="server" ButtonImage="Link.gif"
                        ButtonText="Link" CommandName="Link" Hidden="False" />
                    <radTlb:RadToolbarSeparator ID="RadToolbarSeparator1" runat="server" />
                    <radTlb:RadToolbarTemplateButton runat="server" ID="Radtoolbartemplatebutton1">
                        <ButtonTemplate>
                            <radC:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="true" AutoPostBack="true"
                                OnSelectedIndexChanged="selectionChanged">
                                <Items>
                                    <radC:RadComboBoxItem Text="http://www.telerik.com" />
                                    <radC:RadComboBoxItem Text="http://www.falafel.com" />
                                </Items>
                            </radC:RadComboBox>
                        </ButtonTemplate>
                    </radTlb:RadToolbarTemplateButton>
                </Items>
            </radTlb:RadToolbar>
            <iframe style="width: 683px; height: 489px" id="pageFrame" src="" __designer:dtid="281483566645248"
                runat="server"></iframe>
            
          <textarea id="TextArea1" cols="50" rows="10"></textarea>
        </div>
    </form>
    
    <script type="text/javascript">
    //<!--
        click_handler(null, null); 
    //-->
    </script>
    
</body>
</html>
