Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
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