Geeks With Blogs

News
The Wrecking Bawl Destructuring query language, one keyword at a time.

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();
}

Posted on Thursday, April 9, 2009 4:58 AM all tech stuff , general .Net stuff | Back to top


Comments on this post: ajax loader in user control within master page

No comments posted yet.
Your comment:
 (will show your gravatar)
 


Copyright © Alex Bransky | Powered by: GeeksWithBlogs.net | Join free