Showing posts with label webservice. Show all posts
Showing posts with label webservice. Show all posts

Wednesday, March 28, 2012

UpdateProgress Template and the Control Toolkit

I have an

atlas:UpdateProgress Template on the same page as some cascading drop downs. I have put in a large (5 seconds) delay on the webservice populating the dropdowns but still don't see the ProgressTemplate.

Does the UpdateProgress Template work with the control toolkit or is it just for UpdatePanels?

The Toolkit controls do not natively work with Atlas's UpdateProgress control. I looked into this briefly just now and it doesn't seem like the UpdateProgress control can be used in this way. Rather, it seems to tie itself directly to the "in postback" status of the relevant page. Since there are no postbacks in the CascadingDropDown scenario, UpdateProgress doesn't seem relevant. Sorry about that!

Monday, March 26, 2012

Updating a website with data from an asynchronously called Webservice

Hi!

I wrote the following code to update a label on my aspx-page with data retrieved by an asynchronously called Webservice.

Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.LoadIf Not Page.IsPostBackThen Dim wsAs localhost.WebServiceTest =New localhost.WebServiceTestDim ResultAs IAsyncResult = ws.Beginmessages(AddressOf renderResult, ws)End If End Sub Private Sub renderResult(ByVal ResultAs IAsyncResult)Dim wsAs localhost.WebServiceTest =CType(Result.AsyncState, localhost.WebServiceTest) Label1.Text = ws.Endmessages(Result)End Sub

The problem is that the Label (which is surrounded by an Updatepanel) does not get updated with the value returned by the Webservice although "renderResult" is executed correctly. (Maybe the problem is that the asynchronous function is called in a different thread on the webserver?)

Do you have any ideas or solutions to solve this issue?

Thank you

No suggestions?


Try doing your asynchronous webservice calls from the client-side rather than from the server.

http://www.asp.net/learn/ajax-videos/video-79.aspx

http://www.asp.net/AJAX/Documentation/Live/tutorials/ASPNETAJAXWebServicesTutorials.aspx


As DisturbedBuddha points out, you would probably want to do this sort of thing client side (remember the runat=server thing).

But, if youreally want to do this server side, my first question would be - is the updatepanel inside a form?

Cheers

Martin


Thank you for your help.

Calling the webservice client-side worked!

Wednesday, March 21, 2012

Urgent: Atlas breaking <asp:button> postback

On my form I have an <asp:ImageButton id='Calculate'> which calls a webservice to perform a calculation then populate a textbox.

I also have an <asp:button id='Save' test='Save'> which performs the form submit.

The Save button works correctly posting back to the server unles the Calculate button is pressed. If the Calculate button is pressed the asynchronous call for the calculation works, but afterwards the Save button will no longer postback.

I created <a href="http://links.10026.com/?link=javascript:__doPostBack('Save','')">Save it</a>. This works before the Calculate is pressed and fails after Calculate is pressed (exactly like the Save button).

Any ideas? I have a client I have to show this to in the morning.

thanks.....mac

hello.

not without seeing a small sample that reproduces the error...