Пример #1
0
        protected void OnItemSaved(object sender, WebFormSavedEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            if (e.Exception == null)
            {
                var cs = Page.ClientScript;

                if (!cs.IsClientScriptBlockRegistered(GetType(), "WebFormOnSuccessScript"))
                {
                    cs.RegisterClientScriptBlock(GetType(), "WebFormOnSuccessScript", @"window.parent.postMessage(""Success"", ""*"");", true);
                }
            }
            else if (e.Exception != null && e.Exception.InnerException != null && e.Exception.InnerException.Message != null)
            {
                string errorMessage = TryParseErrorMessage(e.Exception);

                HttpContext.Current.Response.Write(string.Format(HtmlErrorValidationDiv, Page.Server.HtmlEncode(errorMessage)));

                e.ExceptionHandled = true;
            }
        }
Пример #2
0
 protected void OnItemSaved(object sender, WebFormSavedEventArgs e)
 {
 }