The Wrecking Bawl

Destructuring query language, one keyword at a time.


News


I spent hours trying to figure out why my ASP.Net page, which uses a master page with a RadGrid surrounded by a RadAjaxPanel with an AjaxLoadingPanel, would not show the loading message.  I would click on the link to the page in the site menu, then IE would sit and spin for a while until it loaded the entire page, rather than loading the page right away but showing the loading spinner until the data was returned.  What I had to do was add this javascript (w/jQuery) to the user control that the grid was in:

<script type="text/javascript">
    $(document).ready(function() {
        setTimeout(loadGrid, 500);       
    });

    function loadGrid() {
        window['<%=RadAjaxPanel1.ClientID %>'].AjaxRequest('');
    }   
</script>

I'm not sure why I had to make it sleep for half a second, but it wouldn't work until I added that.

I set up a server-side event (OnAjaxRequest="RadAjaxPanel1_AjaxRequest") that fires when AjaxRequest is called in the javascript:

protected void RadAjaxPanel1_AjaxRequest(object sender, AjaxRequestEventArgs e) {
 Presenter.InitializeView();
 BindGrid();
}

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Comments

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: