Hello,
After I add an entity and call Submit Changes on a domain context, the call to StartUpload on the RadUploader will not execute.
I have pasted some example code from what I am doing below. StartUpload is not executed and the completed event is never hit.
Is there something I should be doing that I'm missing? If I switch the order of things and have the radupload run before the submit changes, it works fine. But I have to submit changes first because in my custom rad upload handler, I add the files to a database and I need the new id of the entity submitted.
I am using the Silverlight 2010.2.812.1040 release, Visual Studio 2010, .Silverlight 4, Ria Services
After I add an entity and call Submit Changes on a domain context, the call to StartUpload on the RadUploader will not execute.
I have pasted some example code from what I am doing below. StartUpload is not executed and the completed event is never hit.
Is there something I should be doing that I'm missing? If I switch the order of things and have the radupload run before the submit changes, it works fine. But I have to submit changes first because in my custom rad upload handler, I add the files to a database and I need the new id of the entity submitted.
// add new entity to domain context
myDomainContext.MyEntitySet.Add(myNewEntity);
// call submit changes with call back method
myDomainContext.SubmitChanges(submitOp_Completed, null);
// submit changes call back method
void submitOp_Completed(SubmitOperation submitOp)
{
if (submitOp.HasError)
{
submitOp.MarkErrorAsHandled();
}
if (this.taskerAttachment.CurrentSession.TotalFilesCount != 0)
{
myRadUploader.AdditionalPostFields.Add("newId", myNewEntity.id.ToString());
myRadUploader.UploadFinished += new EventHandler<
EventArgs
>(myRadUploader_UploadFinished);
myRadUploader.StartUpload();
}
}
// raduploader completed method
void myRadUploader_UploadFinished(object sender, EventArgs e)
{
// do stuff
}
I am using the Silverlight 2010.2.812.1040 release, Visual Studio 2010, .Silverlight 4, Ria Services