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

[Solved] ajax refreshing a simple listview

3 Answers 79 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 23 Jun 2009, 04:21 PM
Hi everyone,
hope everyone is well...
I have a problem refreshing my listview.
I have the following function which i call from my telerik popup.
The popup closes and I can confirm this function gets called by the alert("");

The problem I am having is that the $find() line returns null.

 <script type="text/javascript">
        function test() {
            alert("");
            $find("testlistview").ajaxRequest("Rebind");   // returns null
        }
    </script>


<div id="testlistview">
    <asp:ListView ID="ListView1" runat="server">
          ...
    </asp:ListView>
</div>


Can anyone please help me?

Many thanks,




3 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 23 Jun 2009, 04:22 PM
am I missing something
(Can provide further code if needed)
0
James
Top achievements
Rank 1
answered on 23 Jun 2009, 04:26 PM
the error message is: $find("testlistview") is null

0
Rosen
Telerik team
answered on 24 Jun 2009, 08:39 AM
James ,

As you may know $find  method is actually a shorthand of MS AJAX's Sys.Application.findComponent method, which as stated in documentation, retrieves a Component object. However from the code you have pasted it is clear that you are trying to access a div html element instead, which is causing for the error you are getting.

Also please note that ajaxRequest is method of RadAjax control, therefore you should call it on RadAjaxManager or RadAjaxPanel instances.  Please review this online help article.

Greetings,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or