SaaS CMS has officially launched! Learn more now.

EPiFields, edit mode & Validators

We're using EPiFields to insert custom forms (web user controls) into pages. The custom forms contain required field validators which appear to be firing in edit mode of EPiServer which is preventing "Save & Publish". We're just getting a blank warning box appearing (no message) which I can only stop occuring if I remove the required field validators. Does anyone know how I can detect that I'm in edit mode and therefore disable the validators to allow the page to be published? Maybe there's another trick that I'm missing? Thanks, Justin
Aug 14, 2006 16:25
Hi, Until someone from EP responds, you might take a look at For example, we used something like the following for this: public ViewMode CurrentViewMode { get { if (Request.UrlReferrer != null) { string startUrl = Request.UrlReferrer.ToString(); string editMatchString = "/" + Configuration.EditDir; string adminMatchString = "/" + Configuration.AdminDir; bool isAdmin = Regex.IsMatch(startUrl, adminMatchString, RegexOptions.IgnoreCase); bool isEdit = Regex.IsMatch(startUrl, editMatchString, RegexOptions.IgnoreCase); if (isAdmin) return ViewMode.Admin; else if (isEdit) return ViewMode.Edit; } return ViewMode.View; } } .. and .. public enum ViewMode { Edit, Admin, View };
Aug 14, 2006 17:01
* 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.