Showing posts with label processing. Show all posts
Showing posts with label processing. Show all posts

Wednesday, March 28, 2012

Modal popup and continue to run server code

I have a linkbutton that causes a postback for a lengthy process on the server - then the page redirects to a different page for fianl processing - when the linkbutton is pressed I would like a modal popup to appear showing that something is happening and just have a spinnier or something on it - nothing fancy.

However if I wire the modal popup extender to the linkbutton it disrupts the postback - of course if I have the server post code to show the popup by the time it gets to the client the process is done and that is useless - is there a way to show the modal popup and have the postback occur leaving the modla popup visible untill the page redirects or the page finishes its postback

You could use the Dynamic* properties of the modalpopup to use a web service method to do the server side processing. You can then hookup to the populated event so that after the processing has completed, you can redirect to another page.

Saturday, March 24, 2012

Modal Popup with Server-Side search

I'm building a data-driven ASP.NET page for processing phone orders. The page starts out with a listing of the items contained in the order, and the user's billing/shipping info.

I'd like to feature a popup that lets the operator search for additional products to add to the order. Sort of like the modal popup control, but with a Textbox for keyword searches, submit button, and a DataGrid for results. The results grid will have linkbuttons by each search result to add it to the order. Clicking the link button will add the item to the order (updated in the order form below the popup), and close the popup.

Is this possible to do with AJAX? I could do this with a regular javascript window.open popup, but I'm hoping for something that acts more like a fat-client application than a web app.

Thanks,

Frank

Yes it is possible. Here's a simplified version of what you want to do.
http://ajax.asp.net/docs/Samples/UpdatePanelApplicationSample1/cs/UpdatePanel4CS.aspx (the focus of this example is animation but it shows the basic idea of what you described)
Clicking the calendar icon unhides an panel where you could select a date. (You could instead have a DataGrid inside the panel.) When finished, the panel can be hidden. This can be done all with server side controls with no page flicker.

This example code is here:
http://ajax.asp.net/docs/ViewSample.aspx?sref=UpdatePanelApplicationSample1 (UpdatePanel4CS.aspx)

These examples are on this doc page:
http://ajax.asp.net/docs/tutorials/usingMsAjaxLibrary/default.aspx


Thanks... this is a good start for me.