Custom error message i edit mode?

Hi! In edit mode i sometimes get the standard yellow box with an error message if i do something wrong. I'd like to generate this yellow box with an custom error message. Is it possible? My problem is that my page requiers one or more categories to be checked. When page is saved in editmode i can catch the event and check if categories == 0 (no problem), but i dont know how to handle the error if no categories are checked. Hence the custom error message... Help appreciated! /Kimmo
Feb 28, 2008 10:11
Nevermind, i solved it... in global.asax: protected void Instance_SavingPage(object sender, EPiServer.PageEventArgs e) { MyClass.MyFunction(e); } In MyFunction: public static void MyFunction(EPiServer.PageEventArgs e) { try { if (something) { throw new Exception("message"); } } catch (Exception ex) { e.CancelAction = true; e.CancelReason = ex.Message.ToString(); } }
Feb 28, 2008 16:56
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.