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

[Solved] Multiple asp:panels in a RadAjaxPanel

2 Answers 277 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 2
James asked on 01 Sep 2009, 03:40 AM
I have a page with RadAjaxManager on it and 2 RadAjaxPanels.  The first RadAjaxpanel contains 5 dropdowns and is located on the left side of the web page.  The main portion of the page has the other RadAjaxPanel, and it contains 4 different asp:panels.  2 of these panels contain images, the 3rd contains a radio button list and a button, all .NET controls.  The 4th panel contains a asp:repeater control.
On the initial page load the first dropdown in RadAjaxPanel1 contains a list of years, and the image in asp:panel #1 is visible.  Each dropdown will invoke AJAX and change the dropdowns and possibly the asp:panel that is shown in the RadAjaxPanel2.  When a user selects a year from dropdown1, this causes dropdown2 to load vehicle makes and the image in asp:panel #1 visible.  Next a user would select a vehicle make from dropdown2, this would cause dropdown3 to load vehicle models and the image in asp:panel #2 to be visible.  A user would then select a vehicle model from dropdown3 which causes dropdown4 to show the available parts for the vehicle that has been selected.  This would also get all the parts associated with the vehicle selected and bind this list to the repeater in asp:panel #4.  The selectedindex changed event for dropdown4 will do all this and then set the appropriate panel's state to visible=true.
The problem is that the asp:panel #1 with the image is still shown instead of the asp:panel #4 that contains the asp:repeater control.
Any thoughts on why this would happen?

I have tried this with the .NET AJAX scriptmanager, updatepanel, etc. and it each panel in the main portion of the page is displayed when the code instructs it to be displayed.

2 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 2
answered on 01 Sep 2009, 12:12 PM
Here is what the page looks like:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TestTelerikAjax._Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!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>Ajax Test</title> 
    <link href="App_Themes/TestAjax/Keystone.css" rel="stylesheet" type="text/css" /> 
    <link href="MenuSkin/Menu.B2B.css" rel="stylesheet" type="text/css" /> 
    <style type="text/css"
        
        .CenteredLP4ComboBox  
        { 
            background-image:url('./Images/greyedimage.gif'); 
        } 
 
        .CenteredLP4Content 
        { 
            background-image:url('./images/progressbar.gif'); 
            background-position:center; 
            background-repeat:no-repeat; 
        } 
 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="cboYears"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1"  
                            LoadingPanelID="ComboBoxLoadingPanel" /> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel2"  
                            LoadingPanelID="ContentHolderLoadingPanel" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="cboMake"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1"  
                            LoadingPanelID="ComboBoxLoadingPanel" /> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel2"  
                            LoadingPanelID="ContentHolderLoadingPanel" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="cboModel"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1"  
                            LoadingPanelID="ComboBoxLoadingPanel" /> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel2"  
                            LoadingPanelID="ContentHolderLoadingPanel" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="cboCategory"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1"  
                            LoadingPanelID="ComboBoxLoadingPanel" /> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel2"  
                            LoadingPanelID="ContentHolderLoadingPanel" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="btnReset"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1"  
                            LoadingPanelID="ComboBoxLoadingPanel" /> 
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel2"  
                            LoadingPanelID="ContentHolderLoadingPanel" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="ContentHolderLoadingPanel" CssClass="CenteredLP4Content" runat="server" Height="200px" Width="200px" /> 
        <telerik:RadAjaxLoadingPanel ID="ComboBoxLoadingPanel" CssClass="CenteredLP4ComboBox" runat="server" Transparency="65" /> 
        <telerik:RadToolTipManager  ID="RadToolTipManager1" runat="server"  
                AutoCloseDelay="10000" Width="180px" Height="70px" 
                RelativeTo="Element" meta:resourcekey="RadToolTipMgrResource"  
                Position="MiddleRight" Skin="Outlook"
            <WebServiceSettings Path="GetPartToolTip.asmx" Method="GetPartInfo" /> 
            <TargetControls> 
                <telerik:ToolTipTargetControl IsClientID="false" TargetControlID="txtFakeTooltip" Value="" /> 
            </TargetControls> 
        </telerik:RadToolTipManager> 
        <asp:TextBox ID="txtFakeTooltip" runat="server" CssClass="invisible"></asp:TextBox> 
        <div id="divHeader" class="orderentry_header" runat="server"
            <div id="UserCustomerInfo" class="usercustomerinfo_header"
                <asp:Panel ID="pnlNonKipUser" runat="server"
                    <table ID="tblUserInfo" runat="server" width="100%"
                        <tr> 
                            <td align="left"
                                <asp:Label ID="lblUserName" runat="server" ForeColor="White" Font-Size="10px" Font-Bold="True" /> 
                            </td> 
                            <td ID="langButtons" runat="server" align="right"
                                <asp:LinkButton ID="lbLangEnglish" runat="server"  Text="English" ForeColor="White" CommandArgument="en-US"  
                                    CausesValidation="False" />&nbsp; 
                                <asp:LinkButton ID="lbLangFrench" runat="server" Text="Français" ForeColor="White" CommandArgument="fr-CA"  
                                    CausesValidation="False" />&nbsp; 
                            </td> 
                        </tr> 
                        <tr> 
                            <td colspan="2" align="left"
                                <asp:Label ID="lblBusinessName" runat="server" Text="B2B's Body Shop" ForeColor="White" Font-Bold="True" Font-Size="10px" /> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td align="left" colspan="2"
                                <asp:Label ID="lblCustomerTag" runat="server" Text="Customer No:" ForeColor="White"  
                                    Font-Bold="true" Font-Size="10px" EnableViewState="true" />&nbsp; 
                                <asp:Label ID="lblCustomerNbr" runat="server" Text="344249" ForeColor="White" Font-Bold="True" Font-Size="10px" /> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td colspan="2" align="left">  
                                <asp:Label ID="lblContactInfo" runat="server" ForeColor="White" Font-Size="10px"  
                                    Font-Bold="True" Text="Keystone ph: 615-226-9090 fx: 615-226-9577" /> 
                            </td> 
                        </tr> 
                    </table> 
                    <asp:TextBox ID="txtLocalWhse" runat="server" CssClass="invisible"></asp:TextBox> 
                </asp:Panel> 
                <asp:Panel ID="pnlKipUser" runat="server" Visible="false"
                    <table ID="tblKipUserInfo" runat="server" width="100%"
                        <tr> 
                            <td align="left"
                                <asp:Label ID="lblKipUserName" runat="server" ForeColor="White" Font-Size="10px" Font-Bold="True" /> 
                            </td> 
                            <td ID="langButtonsKip" runat="server" align="right"
                                <asp:LinkButton ID="lbLangEnglishKip" runat="server"  Text="English" ForeColor="White"  
                                    CommandArgument="en-US" />&nbsp; 
                                <asp:LinkButton ID="lbLangFrenchKip" runat="server" Text="Français" ForeColor="White"  
                                    CommandArgument="fr-CA" />&nbsp; 
                            </td> 
                        </tr> 
                        <tr> 
                            <td colspan="2" align="left"
                                <asp:Label ID="lblBusinessNameKip" runat="server" ForeColor="White" Font-Bold="True" Font-Size="10px" /> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td colspan="2" align="left"
                                <asp:Label ID="lblKipZipCode" runat="server" ForeColor="White"  
                                    Font-Bold="true" Font-Size="10px" />&nbsp; 
                                <asp:LinkButton ID="lbChangeZipCode" runat="server" Text="Change Zip Code" ForeColor="#FFD500"  
                                    Font-Underline="true" /> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td colspan="2" align="left">  
                                <asp:Label ID="lblKeystoneContact" runat="server" ForeColor="White" Font-Size="10px"  
                                    Font-Bold="True" Text="Keystone ph: 615-226-9090 fx: 615-226-9577" /> 
                            </td> 
                        </tr> 
                    </table> 
                </asp:Panel> 
            </div> 
        </div> 
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" CssClass="left_column"
            <div id="divleftcolumn"
                <asp:Panel ID="pnlCrashCatalog" runat="server"
                    <div class="search" > 
                        <input type="text" id="idSearchPart" name="txtSearchPart" style="width: 200px;" onclick="SelectAll('idSearchPart')" runat="server" /> 
                        <asp:Button ID="btnGo" runat="server" Text="GO" /> 
                        <div style="margin-top:20px;"
                            <asp:DropDownList ID="cboYears" runat="server" SkinID="search"  
                                CssClass="radcombo_search" Width="212px" AutoPostBack="true"
                            </asp:DropDownList> 
                            <asp:DropDownList ID="cboMake" runat="server" SkinID="search"  
                                CssClass="radcombo_search" Width="212px" AutoPostBack="true"
                            </asp:DropDownList> 
                            <asp:DropDownList ID="cboModel" runat="server" SkinID="search"  
                                CssClass="radcombo_search" Width="212px" AutoPostBack="true"
                            </asp:DropDownList> 
                            <asp:DropDownList ID="cboCategory" runat="server" SkinID="search"  
                                CssClass="radcombo_search" Width="212px" AutoPostBack="true"
                            </asp:DropDownList> 
 
                            <div id="option2" style="margin-top:20px;"
                                <asp:DropDownList ID="cboCert" runat="server" SkinID="search"  
                                    CssClass="radcombo_search" Width="212px" AutoPostBack="true"
                                </asp:DropDownList> 
                                <asp:DropDownList ID="cboSize" runat="server" SkinID="search"  
                                    CssClass="radcombo_search" Width="212px" AutoPostBack="true"
                                </asp:DropDownList> 
                            </div> 
                        </div> 
                        <br /> 
                        <asp:Button ID="btnReset" runat="server" SkinID="reset" Text="Reset Search" 
                            CausesValidation="False" TabIndex="3"/> 
                    </div> 
                    <hr /> 
                    <div style="margin-top: 10px;"  > 
                        <table width="100%"
                            <tr> 
                                <td align="center"
                                    <asp:Button ID="btnLogout" runat="server" SkinID="options" Text="Log Out"  
                                        CausesValidation="False"/> 
                                </td> 
                            </tr> 
                        </table> 
                        <div class="cartsummary" style="margin-top: 25px;margin-left: 4px;width: 200px;height:75px;"
                            <asp:Label ID="lblCart" runat="server" Font-Bold="True" Font-Size="Small"  
                                Text="Cart Summary"/> 
                            <br /> 
                            <asp:Label ID="lblCartSummary" runat="server" Font-Italic="False"  
                                Font-Names="verdana" Font-Size="X-Small" SkinID="viewcart"  
                                Text="Your cart is empty" Visible="true" /> 
                            <br /> 
                            <asp:Label ID="lblCartItems" runat="server" SkinID="viewcart" Visible="true" Text="Total Parts:" /> 
                            <asp:Label ID="lblCartTotItems" runat="server" SkinID="viewcart" Visible="true"></asp:Label><br /> 
                            <asp:Label ID="lblCartPrice" runat="server" SkinID="viewcart" Visible="true" Text="Total Price:" /> 
                            <asp:Label ID="lblCartTotPrice" runat="server" SkinID="viewcart" Visible="true"></asp:Label><br /> 
                            <asp:Button ID="btnViewCart" runat="server" CausesValidation="False"   
                                Font-Italic="False" Font-Names="verdana" Font-Size="12px" SkinID="viewcart"  
                                Visible="true" Text="View Cart" /> 
                            <br /> 
                            <hr /> 
                            <asp:Label ID="lblCopyright" runat="server" CssClass="copyright"></asp:Label> 
                        </div> 
                    </div>          
                </asp:Panel> 
            </div> 
        </telerik:RadAjaxPanel> 
        <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" CssClass="CatalogData"
            <asp:Panel ID="pnlContent" runat="server"
                <telerik:RadMenu ID="RadMenu1" runat="server" Width="757px"  
                    style="z-index: 500" Skin="B2B" EnableEmbeddedSkins="false"
                    <CollapseAnimation Type="OutQuint" Duration="200" /> 
                </telerik:RadMenu> 
                <asp:Panel ID="pnlCatalogReady" runat="server" Visible="true" HorizontalAlign="Center" > 
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /> 
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/images/CatalogReady.gif" AlternateText="Catalog Ready" /> 
                </asp:Panel> 
                <asp:Panel ID="pnlNoPartsFound" runat="server" Visible="false"
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /> 
                    <asp:Image ID="Image2" runat="server" ImageUrl="~/images/NoPartsFound.gif" AlternateText="No Parts Found" /> 
                </asp:Panel> 
                <asp:Panel ID="pnlMultipleVehicles" runat="server" Visible="false"
                    <br /><br /><br /> 
                    <div id="vehicles"  style="margin-left: 30px; width: 400px; text-align:left;"
                        <asp:Label ID="lblMultiVehicles" runat="server" /> 
                        <asp:RadioButtonList ID="optVehicles" runat="server" /> 
                        <hr /> 
                        <asp:Button ID="btnSelectVehicle" runat="server" BackColor="#FFD500" Text="Select Vehicle" Height="20px"/> 
                    </div>  
               </asp:Panel> 
               <asp:Panel ID="pnlCatalogData" runat="server" Visible="false"
                    <div id="divCrashCatalog" style="max-height:450px; position: absolute; overflow: auto; width: 760px; left: 240px; top: 105px;"
                        <table style="padding:2px; width:735px; margin-top: 0px; background-color: #e4e6ee;"
                            <asp:Repeater ID="productlist" runat="server"
                                <ItemTemplate> 
                                <tr> 
                                    <td rowspan="4"
                                        <img id="PartImage" style="border:0;" onclick="ShowPartInfo('<%#Eval("partnumber")%>');return false;"  
                                            alt='<%#Eval("description1")%>' src='<%# Eval("thumbnail") %>'  /> 
                                    </td> 
                                    <td colspan="2" align='right'
                                        <img width="60px" height="20px" alt="pplus" src='<%# Eval("ppluspic") %>' /> 
                                        <img width="60px" height="20px" alt="nwcpp" src='<%# Eval("nwcpppic") %>' /> 
                                        <img width="60px" height="20px" alt="nwpp" src='<%# Eval("nwpppic") %>' /> 
                                        <img width="60px" height="20px" alt="capa" src='<%# Eval("capaPic") %>' /> 
                                        <img width="60px" height="20px" alt="keytrac" src='<%# Eval("keytracPic") %>' /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td align="left" colspan="2"
                                        <href="#" onclick="ShowPartInfo('<%#Eval("partnumber") %>');return false;">  
                                        <asp:Label ID="lblPartno" runat="server" ToolTip='<%#Eval("partnumber")%>'  Visible="true"  
                                                Text='<%#Eval("partnumber")%>' Font-Bold="true" font-underline="true" ></asp:Label></a
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td align="left" colspan="2"
                                        <table> 
                                            <tr> 
                                                <td align="left"
                                                    <asp:TextBox ID="txtQuantity" runat="server" Text="1" Width="30px"
                                                    </asp:TextBox> 
                                                </td> 
                                                <td align="left"
                                                    <asp:ImageMap ID="imAddSubQty" runat="server" ImageUrl="~/images/arupdn0.gif" HotSpotMode="Navigate" AlternateText="Add/Subtract Qty" ImageAlign="Middle" ToolTip="Add/Subtract Qty" meta:resourcekey="AddSubtractQtyResource" EnableViewState="False"
                                                        <asp:RectangleHotSpot HotSpotMode="Navigate"  Right="9" Bottom="9" AlternateText="Add Quantity" meta:resourcekey="AddQtyResource" /> 
                                                        <asp:RectangleHotSpot Top="11" Right="9" Bottom="20" HotSpotMode="Navigate" AlternateText="Subtract Quantity" meta:resourcekey="SubtractQtyResource" /> 
                                                    </asp:ImageMap>  
                                                </td> 
                                                <td align="left"
                                                    <input type="button" id="btnAddToCart" runat="server" title="Add To Cart" value="Add to Cart" meta:resourcekey="btnAddToCartResource" /> 
                                                </td> 
                                                <td align="left"
                                                    <%#Eval("description1")%>&nbsp;<%#Eval("description2")%> 
                                                    <asp:Label ID="lbldesc" runat="server" Visible="false" Text='<%#Eval("description1")%>' /> 
                                                    <asp:Label ID="lblDesc2" runat="server" Visible="false" Text='<%#Eval("description2")%>' /><br /> 
                                                </td> 
                                                <td align="left"
                                                    <asp:Label ID="lblCoolInfo" runat="server" Text='<%#Eval("coolinginfo") %>' /> 
                                                </td> 
                                            </tr> 
                                        </table> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td colspan="2" align="left"
                                        <asp:Label ID="lblListPriceHdr" runat="server" Text="List Price: " meta:resourcekey="lblListPriceHdrResource" /> 
                                        <asp:Label ID="lblList" runat="server" Text='<%#Eval("listprice")%>'></asp:Label>  
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td align="center" colspan="3"><hr /></td
                                </tr> 
                                </ItemTemplate> 
                            </asp:Repeater> 
                        </table> 
                    </div> 
                </asp:Panel> 
            </asp:Panel> 
        </telerik:RadAjaxPanel> 
    </form> 
</body> 
</html> 
 

Here is the code behind for the page:
Partial Public Class _Default 
    Inherits System.Web.UI.Page 
#Region "Page Global Variables" 
 
    Private _environment As String = String.Empty 
    Private _wsUserid As String = System.Configuration.ConfigurationManager.AppSettings("userid").ToString 
    Private _wsPasswd As String = System.Configuration.ConfigurationManager.AppSettings("passwd").ToString 
    Private _NoPartsFound As Boolean = False 
#End Region ' Page Global Variables 
#Region "Page Events" 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
        Try 
            If ConfigurationManager.AppSettings.Item("Environment"Is Nothing Then 
                Me._environment = "PROD" 
            Else 
                Me._environment = CType(ConfigurationManager.AppSettings("Environment"), String).Trim 
            End If 
 
            If Not Page.IsPostBack Then 
                'Create menu session object 
                CreateMenuBasedOnUser.IndustryType = "B2BE" 
                CreateMenuBasedOnUser.UserName = "mel.b2b" 
                CreateMenuBasedOnUser.LangChosen = "en-US" 
                CreateMenuBasedOnUser.LocalizationPath = String.Empty 
                CreateMenuBasedOnUser.Keyless = False 
                CreateMenuBasedOnUser.PartHistory = False 
                CreateMenuBasedOnUser.ActiveCompany = "001" 
                CreateMenuBasedOnUser.MultipleCustomers = False 
                Me.Session.Add("SiteMenu", CreateMenuBasedOnUser.AddMenuItems) 
 
                'Load Years dropdown 
                Me.GetYears() 
                Me.cboYears.SelectedIndex = 0 
 
                Me.cboMake.Items.Insert(0, New ListItem("- Select a Make -")) 
                Me.cboModel.Items.Insert(0, New ListItem("- Select a Model - ")) 
 
                Me.GetCertifications() 
 
                Me.cboCategory.Items.Insert(0, New ListItem("All Parts")) 
                Me.cboSize.Items.Insert(0, New ListItem("Any and All Sizes")) 
 
                Me.pnlCatalogData.Visible = False 
                Me.pnlCatalogReady.Visible = True 
                Me.pnlMultipleVehicles.Visible = False 
                Me.pnlNoPartsFound.Visible = False 
            Else 
                Dim y As Integer = 0 
                y = 2 
            End If 
 
            Me.RadMenu1.DataSource = CType(Me.Session.Item("SiteMenu"), DataTable) 
            Me.RadMenu1.DataFieldID = "ID" 
            Me.RadMenu1.DataFieldParentID = "ParentID" 
            Me.RadMenu1.DataTextField = "Text" 
            Me.RadMenu1.DataValueField = "Value" 
            Me.RadMenu1.DataNavigateUrlField = "URL" 
            Me.RadMenu1.DataBind() 
 
            Me.lblCartSummary.Visible = True 
            Me.lblCartItems.Visible = False 
            Me.lblCartTotItems.Visible = False 
            Me.lblCartPrice.Visible = False 
            Me.lblCartTotPrice.Visible = False 
            Me.btnViewCart.Visible = False 
 
        Catch ex As Exception 
            Dim x As String = String.Empty 
            x = ex.Message 
        End Try 
    End Sub 
 
    Private Sub cboYears_SelectedIndexChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles cboYears.SelectedIndexChanged 
        Try 
            Me.cboMake.DataSource = Nothing 
            Me.cboModel.DataSource = Nothing 
            Me.cboCategory.DataSource = Nothing 
            Me.cboSize.DataSource = Nothing 
 
            Me.cboModel.Items.Insert(0, New ListItem("- Select a Model - ")) 
            Me.cboCategory.Items.Insert(0, New ListItem("All Parts")) 
            Me.cboSize.Items.Insert(0, New ListItem("Any and All Sizes")) 
 
            Me.GetMakes(Me.cboYears.SelectedValue.Trim) 
            Me.cboMake.SelectedIndex = 0 
 
            Me.pnlCatalogData.Visible = False 
            Me.pnlCatalogReady.Visible = True 
            Me.pnlMultipleVehicles.Visible = False 
            Me.pnlNoPartsFound.Visible = False 
 
        Catch ex As Exception 
            Dim x As String = String.Empty 
            x = ex.Message 
        End Try 
    End Sub 
 
    Private Sub cboMake_SelectedIndexChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles cboMake.SelectedIndexChanged 
        Try 
            Me.cboModel.DataSource = Nothing 
            Me.cboCategory.DataSource = Nothing 
            Me.cboSize.DataSource = Nothing 
 
            Me.cboCategory.Items.Insert(0, New ListItem("All Parts")) 
            Me.cboSize.Items.Insert(0, New ListItem("Any and All Sizes")) 
 
            Me.GetModels(Me.cboYears.SelectedValue, Me.cboMake.SelectedValue) 
            Me.cboModel.SelectedIndex = 0 
 
            Me.pnlCatalogData.Visible = False 
            Me.pnlCatalogReady.Visible = True 
            Me.pnlMultipleVehicles.Visible = False 
            Me.pnlNoPartsFound.Visible = False 
        Catch ex As Exception 
            Dim x As String = String.Empty 
            x = ex.Message 
        End Try 
    End Sub 
 
    Private Sub cboModel_SelectedIndexChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles cboModel.SelectedIndexChanged 
        Try 
            Me.cboCategory.DataSource = Nothing 
            Me.cboSize.DataSource = Nothing 
 
            Me.cboSize.Items.Insert(0, New ListItem("Any and All Sizes")) 
            Me.cboSize.SelectedIndex = 0 
 
            Me.GetCategories(Me.cboYears.SelectedValue, Me.cboMake.SelectedValue, Me.cboModel.SelectedValue) 
            Me.cboCategory.SelectedIndex = 0 
 
            If Me._environment.Trim.ToUpper = "PROD" Then 
                Me.DisplayPartsProd() 
            Else 
                Me.DisplayPartsTest() 
            End If 
 
            If Me._NoPartsFound Then 
                Me.pnlCatalogData.Visible = False 
                Me.pnlCatalogReady.Visible = False 
                Me.pnlMultipleVehicles.Visible = False 
                Me.pnlNoPartsFound.Visible = True 
            Else 
                Me.pnlCatalogData.Visible = True 
                Me.pnlCatalogReady.Visible = False 
                Me.pnlMultipleVehicles.Visible = False 
                Me.pnlNoPartsFound.Visible = False 
            End If 
        Catch ex As Exception 
            Dim x As String = String.Empty 
            x = ex.Message 
        End Try 
    End Sub 
#End Region ' Page Events 
#Region "Miscellanous Page Functions/Subs" 
 
    Private Sub GetYears() 
        Dim wsGetYears As Object 
        Dim vehicleYears() As String = Nothing 
        Try 
            If Me._environment.Trim.ToUpper = "PROD" Then 
                wsGetYears = New KeystoneCatalogProd.Service 
                vehicleYears = wsGetYears.getYears(Me._wsUserid, Me._wsPasswd, "en-US""001"
            Else 
                wsGetYears = New KeystoneCatalogTest.Service 
                vehicleYears = wsGetYears.getYears(Me._wsUserid, Me._wsPasswd, "en-US""001"
            End If 
 
            Me.cboYears.DataSource = vehicleYears 
            Me.cboYears.DataBind() 
 
            Me.cboYears.Items.Insert(0, New ListItem("- Select a Year -")) 
        Catch ex As Exception 
            Throw New Exception("Error occurred in GetYears. Error: " & ex.Message) 
        Finally 
            If Not wsGetYears Is Nothing Then 
                wsGetYears = Nothing 
            End If 
        End Try 
    End Sub 
 
    Private Sub GetMakes(ByVal selectedYear As String
        Dim wsGetMakes As Object 
        Dim vehicleMakes() As String = Nothing 
        Try 
            If Me._environment.Trim.ToUpper = "PROD" Then 
                wsGetMakes = New KeystoneCatalogProd.Service 
                vehicleMakes = wsGetMakes.getMakes(selectedYear, Me._wsUserid, Me._wsPasswd, "en-US""001"
            Else 
                wsGetMakes = New KeystoneCatalogProd.Service 
                vehicleMakes = wsGetMakes.getMakes(selectedYear, Me._wsUserid, Me._wsPasswd, "en-US""001"
            End If 
 
            Me.cboMake.DataSource = vehicleMakes 
            Me.cboMake.DataBind() 
 
            Me.cboMake.Items.Insert(0, New ListItem("- Select a Make -")) 
 
        Catch ex As Exception 
            Throw New Exception("Error occurred in GetMakes. Error: " & ex.Message) 
        Finally 
            If Not wsGetMakes Is Nothing Then 
                wsGetMakes = Nothing 
            End If 
        End Try 
    End Sub 
 
    Private Sub GetModels(ByVal selectedYear As StringByVal selectedMake As String
        Dim wsGetModels As Object 
        Dim vehicleModels() As String = Nothing 
        Try 
            If Me._environment.Trim.ToUpper = "PROD" Then 
                wsGetModels = New KeystoneCatalogProd.Service 
                vehicleModels = wsGetModels.getModels(selectedYear, selectedMake, Me._wsUserid, Me._wsPasswd, "en-US""001"
            Else 
                wsGetModels = New KeystoneCatalogTest.Service 
                vehicleModels = wsGetModels.getModels(selectedYear, selectedMake, Me._wsUserid, Me._wsPasswd, "en-US""001"
            End If 
 
            Me.cboModel.DataSource = vehicleModels 
            Me.cboModel.DataBind() 
 
            Me.cboModel.Items.Insert(0, New ListItem("- Select a Model -")) 
        Catch ex As Exception 
            Throw New Exception("Error occurred in GetModels. Error: " & ex.Message) 
        Finally 
            If Not wsGetModels Is Nothing Then 
                wsGetModels = Nothing 
            End If 
        End Try 
    End Sub 
 
    Private Sub GetCategories(ByVal selectedYear As StringByVal selectedMake As StringByVal selectedModel As String
        Dim wsGetCategory As Object 
        Dim vehicleCategories() As String = Nothing 
        Try 
            If Me._environment.Trim.ToUpper = "PROD" Then 
                wsGetCategory = New KeystoneCatalogProd.Service 
                vehicleCategories = wsGetCategory.getCategories(selectedYear, selectedMake, selectedModel, Me._wsUserid, Me._wsPasswd, _ 
                        "en-US""001"
            Else 
                wsGetCategory = New KeystoneCatalogTest.Service 
                vehicleCategories = wsGetCategory.getCategories(selectedYear, selectedMake, selectedModel, Me._wsUserid, Me._wsPasswd, _ 
                        "en-US""001"
            End If 
 
            Me.cboCategory.DataSource = vehicleCategories 
            Me.cboCategory.DataBind() 
 
        Catch ex As Exception 
            Throw New Exception("Error occurred in GetCategories. Error: " & ex.Message) 
        Finally 
            If Not wsGetCategory Is Nothing Then 
                wsGetCategory = Nothing 
            End If 
        End Try 
    End Sub 
 
    Private Sub GetCertifications() 
        Dim wsGetCerts As Object 
        Dim vehicleCerts() As String = Nothing 
        Try 
            If Me._environment.Trim.ToUpper = "PROD" Then 
                wsGetCerts = New KeystoneCatalogProd.Service 
                vehicleCerts = wsGetCerts.getCertifications(Me._wsUserid, Me._wsPasswd, "en-US""001"
            Else 
                wsGetCerts = New KeystoneCatalogTest.Service 
                vehicleCerts = wsGetCerts.getCertifications(Me._wsUserid, Me._wsPasswd, "en-US""001"
            End If 
 
            Me.cboCert.DataSource = vehicleCerts 
            Me.cboCert.DataBind() 
 
            Me.cboCert.SelectedIndex = 0 
        Catch ex As Exception 
            Throw New Exception("Error occurred in GetCertifications. Error: " & ex.Message) 
        Finally 
            If Not wsGetCerts Is Nothing Then 
                wsGetCerts = Nothing 
            End If 
        End Try 
    End Sub 
 
    Private Sub GetSizes() 
        Try 
 
        Catch ex As Exception 
            Throw New Exception("Error occurred in GetSizes. Error: " & ex.Message) 
        End Try 
    End Sub 
 
    'This sub will take the vehicle session variables and call the parts_service web service to get the parts for the users  
    '   selection. 
    Private Sub DisplayPartsProd() 
        Dim oservice As Object 
        Dim rs As Object 
        Try 
            oservice = New KeystoneCatalogProd.Service 
            rs = New KeystoneCatalogProd.PartsResponse 
            Dim warehouse As String = "145" 
            Dim vehicle_year As String = Me.cboYears.SelectedValue 
            Dim vehicle_make As String = Me.cboMake.SelectedValue 
            Dim vehicle_model As String = Me.cboModel.SelectedValue 
            Dim vehicle_category As String = Me.cboCategory.SelectedValue 
            Dim vehicle_cert As String = Me.cboCert.SelectedValue 
            Dim vehicle_size As String = Me.cboSize.SelectedValue 
 
            Dim dt As New DataTable 
 
            rs = oservice.getAllAMParts(vehicle_year, vehicle_make, vehicle_model, "344249", _ 
               vehicle_category, Me._wsUserid, Me._wsPasswd, "en-US", warehouse, _ 
               vehicle_cert, vehicle_size, "001"
 
            If rs.Success Then 
                If rs.parts.length = 0 Then 
                    Me._NoPartsFound = True 
                End If 
                Me.productlist.DataSource = rs.Parts 
                Me.productlist.DataBind() 
            Else 
                Throw New Exception(rs.ErrorMsg) 
            End If 
 
        Catch ex As Exception 
            Dim newErrMsg As String = "Error occurred in DisplayPartsProd. Error: " & ex.Message 
            Throw New Exception(newErrMsg) 
        Finally 
            If Not oservice Is Nothing Then 
                oservice.dispose() 
                oservice = Nothing 
            End If 
        End Try 
 
    End Sub 
 
    'This sub will take the vehicle session variables and call the parts_service web service to get the parts for the users  
    '   selection. 
    Private Sub DisplayPartsTest() 
        Dim oservice As Object 
        Dim rs As Object 
        Try 
            oservice = New KeystoneCatalogTest.Service 
            rs = New KeystoneCatalogTest.PartsResponse 
            Dim warehouse As String = "145" 
            Dim vehicle_year As String = Me.cboYears.SelectedValue 
            Dim vehicle_make As String = Me.cboMake.SelectedValue 
            Dim vehicle_model As String = Me.cboModel.SelectedValue 
            Dim vehicle_category As String = Me.cboCategory.SelectedValue 
            Dim vehicle_cert As String = Me.cboCert.SelectedValue 
            Dim vehicle_size As String = Me.cboSize.SelectedValue 
 
            Dim dt As New DataTable 
            rs = oservice.getAllAMParts(vehicle_year, vehicle_make, vehicle_model, "344249", _ 
               vehicle_category, Me._wsUserid, Me._wsPasswd, "en-US", warehouse, _ 
               vehicle_cert, vehicle_size, "001"
 
            If rs.Success Then 
                If rs.parts.length = 0 Then 
                    Me._NoPartsFound = True 
                End If 
                Me.productlist.DataSource = rs.Parts 
                Me.productlist.DataBind() 
            Else 
                Throw New Exception(rs.ErrorMsg) 
            End If 
 
        Catch ex As Exception 
            Dim newErrMsg As String = "Error occurred in DisplayPartsTest. Error: " & ex.Message 
            Throw New Exception(newErrMsg) 
        Finally 
            If Not oservice Is Nothing Then 
                oservice.dispose() 
                oservice = Nothing 
            End If 
            rs = Nothing 
        End Try 
 
    End Sub 
#End Region ' Miscellanous Page Functions/Subs 
 
End Class 



0
SamJ
Top achievements
Rank 1
answered on 03 Sep 2009, 06:06 AM
Hi James,

I would suggest you to replace the RadAjaxPanels with ASP:Panel controls and ajaxify them as it is described here.

I hope it would help you solve the mentioned issues.

SamJ
Tags
Ajax
Asked by
James
Top achievements
Rank 2
Answers by
James
Top achievements
Rank 2
SamJ
Top achievements
Rank 1
Share this question
or