Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to create async load of visual web part. Code behind (web part) needs some time to load data so I figure to create that in async way (on page load). Scriptmanager is placed in master page (ajax support is enabled) so I tried to do that with asp:update panel (+ update progress control - to be shown while data is not loaded) but i don't know how to do postback because I don't have any control which should be triggered to do postback (and I must not have any(!), at least to be visible). I found some documentation about SPG.AJAXSupport but solution for VS2010 doesn't have project for AJAXSupport, and solution for VS2008 (MOSS 2007) I can't open because it need some wild project templates which I can't find.

Please can somebody can give me some valuable information how can I do that (via javascript or any other reasonable way)?!? Also does somebody have binaries of SPG to send me?

My javascript code (for now) looks like:

<script language="javascript" type="text/javascript">
var prm = Sys.WebForms.PageRequestManager.getInstance();

prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
var postBackElement;

//fired when the update starts
function InitializeRequest(sender, args) {
    postBackElement = args.get_postBackElement();
    var mainPanel = document.getElementById('<%=panelMain.ClientID%>');
    mainPanel.style.display = 'none';
}

//fired when the update ends
function EndRequest(sender, args) {
    //Show your update panel here
}
</script>
share|improve this question

1 Answer 1

up vote 0 down vote accepted

I think you want to use a Timer inside your UpdatePanel.

For example (from the article):

<asp:UpdatePanel runat="server" id="UpdatePanel1">
<ContentTemplate>
<asp:Timer runat="server" id="Timer1" Interval="10000" OnTick="Timer1_Tick"></asp:Timer>
<asp:Label runat="server" Text="Page not refreshed yet." id="Label1">
</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
share|improve this answer
    
It works! Thousand times thank you!!! –  trip Jul 22 '11 at 14:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.