Hi,
I'm trying to make an asynchronous call using the new event model (the old Beginxxx/Endxxx has been phased out it seems and these methods are not generated from the WSDL by VS2005/2008).
When I make the call I get the following error (see bottom for full). This is because you need to have the Page directive of Async="true". I am of course using a UserControl so I do not have control over this and cannot change the Default.aspx page.
Has anyone called a webservice asynchronously and got around this problem?
ModuleId: 781
ModuleDefId: 234
FriendlyName: [L]Edit Post
ModuleControlSource: DesktopModules/Smart-Thinker - Wall/PostEdit.ascx
AssemblyVersion: 04.06.02
PortalID: 0
PortalName: My Website
UserID: 2
UserName: admin
ActiveTabID: 158
ActiveTabName: User Profile
RawURL: /dotnetnuke/Home/User-Profile/ctl/Edit/mid/781/rid/2.aspx
AbsoluteURL: /DotNetNuke/Default.aspx
AbsoluteURLReferrer: http://localhost/dotnetnuke/Home/User-Profile/ctl/Edit/mid/781/rid/2.aspx
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: b534706e-026f-403c-a7cf-b46945e7b54a
InnerException: Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.AspNetSynchronizationContext.OperationStarted
StackTrace:
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event. ---> System.InvalidOperationException: Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event. at System.Web.AspNetSynchronizationContext.OperationStarted() at System.ComponentModel.AsyncOperationManager.CreateOperation(Object userSuppliedState) at System.Web.Services.Protocols.SoapHttpClientProtocol.InvokeAsync(String methodName, Object[] parameters, SendOrPostCallback callback, Object userState) at SmartThinker.DNN.Modules.Wall.StoryFeedWS.StoryFeedWS.AddActionAsync(Int32 actionType, Int32 relatedID, String actionText, Int32 createdByUserID, Object userState) in F:\DotNetNuke_4.3.1_Source\Website\DesktopModules\Smart-Thinker - Wall\Web References\StoryFeedWS\Reference.cs:line 96 at SmartThinker.DNN.Modules.Wall.StoryFeedWS.StoryFeedWS.AddActionAsync(Int32 actionType, Int32 relatedID, String actionText, Int32 createdByUserID) in F:\DotNetNuke_4.3.1_Source\Website\DesktopModules\Smart-Thinker - Wall\Web References\StoryFeedWS\Reference.cs:line 88 at SmartThinker.DNN.Modules.Wall.PostEdit.PublishStoryIntegration(SmartThinker_WallPostInfo smartThinker_WallPostInfo) in F:\DotNetNuke_4.3.1_Source\Website\DesktopModules\Smart-Thinker - Wall\PostEdit.ascx.cs:line 280 at SmartThinker.DNN.Modules.Wall.PostEdit.UpdatePost(SmartThinker_WallPostController smartThinker_WallPostController, SmartThinker_WallPostInfo smartThinker_WallPostInfo) in F:\DotNetNuke_4.3.1_Source\Website\DesktopModules\Smart-Thinker - Wall\PostEdit.ascx.cs:line 181 at SmartThinker.DNN.Modules.Wall.PostEdit.cmdUpdate_Click(Object sender, EventArgs e) in F:\DotNetNuke_4.3.1_Source\Website\DesktopModules\Smart-Thinker - Wall\PostEdit.ascx.cs:line 137 --- End of inner exception stack trace ---
Source:
[L]Server Name: RODDEV