Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i need to do synchronous call to server side events in my asp.net web forms pages. I want that when I call server event asp.net blocks other actions in page waiting the response. Is it possible or there is a framework to do this !?

Thanks!
Posted

1 solution

Every server side event means reloading the page so you should be fine.

If you have partial page update then you have to do it like this:
In your caller control, probably button, add OnClientClick="doModal()"

JavaScript
function doModal() {

// cover whole screen with black, 0.8 transparent div with high z-index
// centered over background div put a panel with some message informing the user what is going on

//do your ajax call

// on finish, clear the cover

}


Alternate solution is to use ajaxToolkit like this:
ASP.NET
<ajaxToolkit:ModalPopupExtender ID="mpeProgress" runat="server" TargetControlID="pnlProgress"
    PopupControlID="pnlProgress" BackgroundCssClass="modalBackground" DropShadow="true" />

    <asp:panel id="pnlProgress" runat="server" style="background-color: #EEEEEE; display: none;<br mode=" hold=" />        width: 400px" xmlns:asp="#unknown">
        <div style="padding: 28px; height: 80px; text-align: center">
Loading, please wait
                            <asp:image id="imgWait" runat="server" imageurl="~/images/indicator-big.gif" borderwidth="0px" />
        </div>
    </asp:panel>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900