/// <summary> /// Executes a <see cref="WxeFunction"/> outside the current function's context (i.e. asynchron) using the /// current window or frame. The execution engine uses a redirect request to transfer the execution to the new function. /// </summary> /// <include file='..\..\doc\include\ExecutionEngine\WxePageExtensions.xml' path='WxePageExtensions/ExecuteFunctionExternal/param[@name="page" or @name="function" or @name="sender" or @name="createPermaUrl" or @name="useParentPermaUrl" or @name="urlParameters" or @name="returnToCaller" or @name="callerUrlParameters"]' /> public static void ExecuteFunctionExternal( this IWxePage page, WxeFunction function, Control sender, bool createPermaUrl, bool useParentPermaUrl, NameValueCollection urlParameters, bool returnToCaller, NameValueCollection callerUrlParameters) { var permaUrlOptions = CreatePermaUrlOptions((createPermaUrl || urlParameters != null), useParentPermaUrl, urlParameters); var options = new WxeCallOptionsExternalByRedirect(permaUrlOptions, returnToCaller, callerUrlParameters); var arguments = new WxeCallArguments(sender, options); Execute(page, function, arguments); }
public void ExecuteFunctionExternalByRedirect(WxeFunction function, Control sender, WxeCallOptionsExternalByRedirect options) { ArgumentUtility.CheckNotNull("function", function); ArgumentUtility.CheckNotNull("sender", sender); ArgumentUtility.CheckNotNull("options", options); WxeReturnOptions returnOptions; if (options.ReturnToCaller) { returnOptions = new WxeReturnOptions(options.CallerUrlParameters ?? _page.GetPermanentUrlParameters()); } else { returnOptions = WxeReturnOptions.Null; } WxePermaUrlOptions permaUrlOptions = options.PermaUrlOptions; _wxePageInfo.CurrentPageStep.ExecuteFunctionExternalByRedirect(new PreProcessingSubFunctionStateParameters(_page, function, permaUrlOptions), returnOptions); }