Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
string JavaScriptString = "";
HttpContext.Current.Response.Write(String.Format(JavaScriptString, "error message"));
/Christoffer
protected static void OnMovingPage(object sender, PageEventArgs e) { e.CancelAction = true; if (null != HttpContext.Current) { Page page = HttpContext.Current.Handler as Page; if (null != page) { page.ClientScript.RegisterClientScriptBlock(typeof(debug), "message", @"
<SCRIPT type=text/javascript><![CDATA[
window.attachEvent('onload', function () { alert('Couldnt delete page because....'); });
]]></SCRIPT>
"); } } }
Note that you have to check HttpContext.Current.Handler for validity, as the MovingPage event might be triggered from scheduled jobs or other background threads running without user intervention. Best regards, Johan Olofsson EPiServer AB