Hello,
I have a small problem where items in a listbox are not visible after it has been populated. The setup is very simple in that I have the RadAjaxManager and a RadAjaxLoadingPanel. The RadAjaxManager is setup where I have a button as the AjaxControlID and the UpdateControl is the listbox. When I click the button, which does a call to active directory to get a list of users and then populate those users in the listbox, the loadingpanel shows as expected over the listbox. However, when the operation is complete and the loading panel is gone, the listbox appears empty with no items. If I cause a post back from some other action, the items that should have appeared in the listbox will suddenly show up. Without the AjaxManager and LoadingPanel, clicking the button will cause a normal postback and the listbox will properly display the items that were added to it. Following is my html and the code for populating the box.
Thanks,
Ron
I have a small problem where items in a listbox are not visible after it has been populated. The setup is very simple in that I have the RadAjaxManager and a RadAjaxLoadingPanel. The RadAjaxManager is setup where I have a button as the AjaxControlID and the UpdateControl is the listbox. When I click the button, which does a call to active directory to get a list of users and then populate those users in the listbox, the loadingpanel shows as expected over the listbox. However, when the operation is complete and the loading panel is gone, the listbox appears empty with no items. If I cause a post back from some other action, the items that should have appeared in the listbox will suddenly show up. Without the AjaxManager and LoadingPanel, clicking the button will cause a normal postback and the listbox will properly display the items that were added to it. Following is my html and the code for populating the box.
<%@ Page Title="" Language="VB" MasterPageFile="~/site.master" AutoEventWireup="false" CodeFile="securitymanagement.aspx.vb" Inherits="pages_securitymanagement" %> <asp:Content ID="HeaderContent" ContentPlaceHolderID="SiteHeadContent" Runat="Server"> </asp:Content> <asp:Content ID="BodyContent" ContentPlaceHolderID="SiteBodyContent" Runat="Server"> <telerik:RadAjaxManager ID="RadAjaxManager" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="SearchForObject"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="ObjectList" LoadingPanelID="RadAjaxLoadingPanel" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" Runat="server" /> <telerik:RadSplitter runat="Server" ID="SiteParent" Width="100%" BorderSize="0" BorderStyle="None" PanesBorderSize="0" Height="100%" Orientation="Vertical" VisibleDuringInit="false"> <telerik:RadPane ID="LeftPane" runat="server" Width="300px" Scrolling="None"> <div class="padding20"> <h4>Security Tasks</h4> <div class="padding10top"> <asp:RadioButtonList ID="SecurityTasks" runat="server" AutoPostBack="true"> <asp:ListItem Text="Role Management" Value="0" Selected="True" /> <asp:ListItem Text="Membership Managment" Value="1" /> </asp:RadioButtonList> </div> </div> </telerik:RadPane> <telerik:RadPane ID="RightPane" runat="server" Scrolling="Both" Height="100%" CssClass="panefix"> <div class="padding20"> <telerik:RadMultiPage ID="MultiPage" SelectedIndex="0" RenderSelectedPageOnly="true" runat="server"> <telerik:RadPageView ID="RolesPage" runat="server"> <h4>Role Management</h4> <div class="padding10top"> <div class="floatleft"> <asp:Panel ID="CurrentRolesGroup" runat="server" GroupingText="Current Roles"> <div class="padding10"> <div> <telerik:RadListBox ID="RolesList" runat="server" Height="300px" AutoPostBack="true" Width="255px" DataSourceID="RoleManagementDataSource" DataKeyField="RoleName" DataSortField="RoleName" DataTextField="RoleName" DataValueField="RoleName" /> </div> <div class="padding10top"><telerik:RadButton ID="RemoveRole" Text="Remove" runat="server" Width="100px" /></div> </div> </asp:Panel> </div> <div class="floatleft padding20left"> <asp:Panel ID="RolePermissionsGroup" runat="server" GroupingText="Role Permissions"> <div class="padding10"> <div> <telerik:RadListBox ID="RolePermissions" runat="server" Height="300px" Width="255px" CheckBoxes="true" DataSourceID="PermissionsDataSource" DataKeyField="permission_id" DataTextField="name" DataValueField="permission_id" Enabled="false" /> </div> <div class="padding10top"><telerik:RadButton ID="ApplyPerms" Text="Apply" runat="server" Width="100px" /></div> </div> </asp:Panel> </div> <div class="floatleft clear"> <asp:Panel ID="NewRoleGroup" runat="server" GroupingText="Role Permissions"> <div class="padding10"> <div><telerik:RadTextBox ID="NewRole" runat="server" Width="250px" /></div> <div class="padding10top"><telerik:RadButton ID="AddRole" Text="Add" runat="server" Width="100px" /></div> </div> </asp:Panel> </div> </div> </telerik:RadPageView> <telerik:RadPageView ID="MembershipPage" runat="server"> <h4>Membership Management</h4> <div class="padding10top"> <div class="floatleft"> <asp:Panel ID="RoleMembersGroup" runat="server" GroupingText="Current Roles"> <div class="padding10"> <div>Select Role:</div> <div> <asp:DropDownList ID="SelectRole" runat="server" DataSourceID="RoleManagementDataSource" DataTextField="RoleName" DataValueField="RoleName" AutoPostBack="true" Width="250px" /> </div> <div class="padding10top"> <telerik:RadListBox ID="MembersList" runat="server" Height="300px" Width="255px" DataSourceID="MembersDataSource" DataKeyField="UserName" DataTextField="UserName" DataValueField="UserName" /> </div> <div class="padding10top"><telerik:RadButton ID="RemoveMember" Text="Remove" runat="server" Width="100px" /></div> </div> </asp:Panel> </div> <div class="floatleft padding20left"> <asp:Panel ID="SearchMembersGroup" runat="server" GroupingText="Role Permissions"> <div class="padding10"> <div>Search User or Group:</div> <div><telerik:RadTextBox ID="ObjectToSearch" runat="server" Width="350px" /></div> <div class="padding10top"> <telerik:RadListBox ID="ObjectList" runat="server" Height="300px" Width="355px" Sort="Ascending" /> </div> <div class="padding10top"> <telerik:RadButton ID="SearchForObject" Text="Search" runat="server" Width="100px" /> <telerik:RadButton ID="AddObject" Text="Add" runat="server" Width="100px" /> </div> </div> </asp:Panel> </div> </div> </telerik:RadPageView> </telerik:RadMultiPage> </div> </telerik:RadPane> </telerik:RadSplitter> <asp:SqlDataSource ID="RoleManagementDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:aspcfg_db %>" SelectCommand="aspnet_Roles_GetAllRoles" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:Parameter Name="ApplicationName" DefaultValue="MAC" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="PermissionsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:mac_db %>" SelectCommand="Permissions_GetAllPermissions" SelectCommandType="StoredProcedure"> </asp:SqlDataSource> <asp:SqlDataSource ID="MembersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:aspcfg_db %>" SelectCommand="aspnet_UsersInRoles_GetUsersInRoles" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ControlParameter ControlID="SelectRole" Name="RoleName" PropertyName="SelectedValue" Type="String" /> <asp:Parameter Name="ApplicationName" DefaultValue="MAC" Type="String" /> </SelectParameters> </asp:SqlDataSource> </asp:Content> Protected Sub SearchForObject_Click(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles SearchForObject.Click If Not ObjectToSearch.Text = String.Empty Then ObjectList.Items.Clear() Dim searchedObjects As SearchResultCollection = SearchForUsersGroups(ObjectToSearch.Text) For Each oneObject As SearchResult In searchedObjects Dim item As RadListBoxItem If oneObject.Properties.Contains("displayName") Then item = New RadListBoxItem( _ oneObject.Properties("displayName")(0).ToString, _ oneObject.Properties("distinguishedName")(0).ToString) Else item = New RadListBoxItem( _ oneObject.Properties("name")(0).ToString, _ oneObject.Properties("distinguishedName")(0).ToString) End If ObjectList.Items.Add(item) Next ObjectList.SortItems() End IfEnd SubThanks,
Ron