ajax stops working after deleting the last item from listbox

2 posts, 0 answers
  1. ido nahmias
    ido nahmias avatar
    64 posts
    Member since:
    May 2006

    Posted 29 May 2014 Link to this post


    Ajax stops working after deleting the last item from Listbox

    I have listbox, panel and 2 buttons- the first button deletes items from the listbox using java script (1) and the second button is  used to send ajax requests in order to hide and show the panel (2).

    While deleting the items from the listbox, the ajax buttons works and hides/shows the panel but after deleting the last item from the listbox, the ajax stops working.

    There is no error in the client side and neither on server side- I add break points at the server side in the Page_Load, I notice the function wasn't even called.

    (2)- panel.visible=false/true


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 May 2014 in reply to ido nahmias Link to this post

    Hi ido nahmias,

    Please have a look into the sample code snippet which works fine at my end. Please provide your code if it doesn't help.

    <telerik:RadListBox ID="RadListBox1" runat="server">
            <telerik:RadListBoxItem Text="Item1" />
            <telerik:RadListBoxItem Text="Item2" />
            <telerik:RadListBoxItem Text="Item3" />
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
        <telerik:RadTextBox ID="RadTextBox1" runat="server" Text="Test">
    <telerik:RadButton ID="RadButton1" runat="server" Text="DeleteItem" AutoPostBack="false"
    <telerik:RadButton ID="RadButton2" runat="server" Text="Change Visibility" OnClick="RadButton2_Click">

    <script type="text/javascript">
        function DeleteSelectedItem(sender, args) {
            var listbox = $find("<%=RadListBox1.ClientID %>");
            var button = $find("<%=RadButton2.ClientID%>");

    protected void RadButton2_Click(object sender, EventArgs e)
        if (RadAjaxPanel1.Visible==true)
            RadAjaxPanel1.Visible = false;
            RadAjaxPanel1.Visible = true;

Back to Top