开发者

Prevent postback in current page while chunking and sending data to a WCF service

开发者 https://www.devze.com 2022-12-08 00:18 出处:网络
I have a silverlight app on an MVC page that user\'s can draw on, when they click save an event fires in both MVC and silverlight

I have a silverlight app on an MVC page that user's can draw on, when they click save an event fires in both MVC and silverlight

The MVC event redirects to a page where the drawing is reloaded so the user can confirm it was saved correctly (viewed on another silverlight app)

The silverlight application event fires off a routine that converts the existing stroke collection into simple xml, and breaks it down into 500 character chunks to be sent to the WCF service that saves the chunks to the dat开发者_高级运维abase.

On the other side of the MVC event the silverlight app fires off a call to the WCF service to retrieve all of the chunked xml strings and brings them in and reassembles them and then rebuilds them into the stroke collection.

now for the problem. My service doesn't seem to catch all of the chunks its being sent, sometimes its only getting 1-3 of the possible 10 or more chunks, i have tested my splitting and conversion routines and guarantee that they work but what im looking for is a way to hold off on firing the MVC event so the WCF maybe can "catch up"? or is that not even the problem

as of now i am at a loss

Thanks guys.


I faced a similar problem uploading files as data chunks; check if you're using a async pattern to communicate with service (default behavior).

If yes, probably all packets are being sent, but you're rebuilding them in a different order.


I resolved this issue by removing the form from the page and leaving it entirely up to the silverlight to do the redirect after sending all of the chunks by grabbing the submit button from the DOM and attaching an event to it

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号