Showing posts with label scenario. Show all posts
Showing posts with label scenario. Show all posts

Saturday, March 24, 2012

Question about atlas and web interface update

Is the following scenario possible with atlas:

A web based application is run on a server, so clients use web browser to access it. The application uses inforamation from a database to populate the UI with the information. The information is stored in a database and can be changed either from the application or some other source (lets say another server). Is is possible to update the UI on a user's computer when the database is updated from the other server (the user doesn't need to refresh the screen manualy)?

Thanks in advance,
Marko Vuksanovic.

hello.

well, it's possible, though probably not as you wanted. what you must do is poll the server from the client from x to x seconds and if there's new info, then refresh the client. the most common approach is:

1- wrap the contents that need to be refreshed with an updatepanel

2- call the web service from x to x seconds; if there's new info, then refresh the panel.

Wednesday, March 21, 2012

Question about updatepanel

Hi,
I got a problem about update panel.
My scenario is that:
I have two tasks, each of which is triggered by buttons..
"A" needs 10 seconds to complete, and "B" needs 2 seconds.
After clicking A button, the user click B within 10 seconds.
Normally the program will stop doing A and start doing B, right?
But once I use the UpdatePanel, it just keep doing A and doesn't do B.
WHY?

Here is my example code:

<body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True"/> <asp:Button ID="ButtonA" runat="server" Text="intensive task" /> <asp:Button ID="ButtonB" runat="server" Text="interrupt task" />  <asp:Label ID="Label2" runat="server" /> <atlas:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" /l> </ContentTemplate> <Triggers> <atlas:ControlEventTrigger ControlID="ButtonA" EventName="Click" /> </Triggers> </atlas:UpdatePanel> <atlas:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> Processing... </ProgressTemplate> </atlas:UpdateProgress> </form> </body>
Protected Sub ButtonA_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles ButtonA.Click System.Threading.Thread.Sleep(10000) Label1.Text ="Intensive task suceeded!!"End Sub Protected Sub ButtonB_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles ButtonB.Click Label2.Text ="Interrupted task succeeded!!"End Sub
I need the normal function, that is to stop A and do B when clicking ButtonB, and also the function of partial refreshing. Any ideas?Could anyone give me some suggestion?