Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        string ICallbackEventHandler.GetCallbackResult()
        {
            string argument = this._callbackArgument;

            this._callbackArgument = null;

            Dictionary <string, object> callInfo = JSONSerializerExecute.DeserializeObject(argument, typeof(Dictionary <string, object>)) as Dictionary <string, object>;

            string serverControlType = (string)callInfo["serverControlType"];
            string originalControlID = (string)callInfo["originalControlID"];

            Page    page    = WebUtility.GetCurrentPage();
            Control control = null;

            if (originalControlID.IsNotEmpty())
            {
                control = page.FindControl(originalControlID);
            }

            if (control == null)
            {
                control    = (Control)TypeCreator.CreateInstance(serverControlType);
                control.ID = originalControlID;
                page.Controls.Add(control);

                if (TargetControlLoaded != null)
                {
                    TargetControlLoaded(control);
                }
            }

            return(ScriptObjectBuilder.ExecuteCallbackMethod(control, callInfo));
        }
Ejemplo n.º 2
0
        protected virtual string GetCallbackResult()
        {
            string argument = _callbackArgument;

            _callbackArgument = null;

            Dictionary <string, object> callInfo = JSONSerializerExecute.DeserializeObject(argument, typeof(Dictionary <string, object>)) as Dictionary <string, object>;

            return(ScriptObjectBuilder.ExecuteCallbackMethod(this, callInfo));
        }