1
Vote

If Viewname is misspelled, or not found then it throws exception

description

If you can just avoid the exception throwing made by this function
public IHtmlString RenderView(string viewName, ViewDataDictionary viewData, bool executeDataRule)

When the view doesn't exist, or the name misspelled, and log the error somewhere else.

I use this to avoid throwing the exception

Kooboo.CMS.Sites.Models.View view = Kooboo.CMS.Sites.Models.IPersistableExtensions.AsActual(new Kooboo.CMS.Sites.Models.View(this.PageContext.PageRequestContext.Site, viewName).LastVersion());
  if (view == null)//Ignore the error and don't proceed
  {
    return new HtmlString("");        
  }

comments

hjf1223 wrote Oct 18, 2011 at 3:15 PM

Yes, it is possible to avoid the exception, but How to notice the developer that view does not exist (OR removed).

kooboo wrote Feb 27, 2012 at 6:49 AM

Thanks, the issue was fixed. Ignore the lost view.

kooboo wrote Feb 27, 2012 at 6:49 AM

Will released in 3.2