Global definition of how to render a control when the model is null (across web controls, user controls, and razor controls)
예제 #1
0
 protected override void RenderWhenModelIsNull(System.Web.UI.HtmlTextWriter writer)
 {
     if (IsEditing || IsPreviewing)
     {
         NullModelHelper.RenderNullModelMessage(writer, ViewPath, DataSource, PresenterFactory.GetPresenter <TModel>().GetType(), typeof(TModel));
     }
 }
예제 #2
0
 /// <summary>
 /// Method called when it is time to render the control but the Model is null. By default causes the control to render nothing unless in Page Editor or Preview mode.
 /// </summary>
 protected virtual void RenderWhenModelIsNull(HtmlTextWriter writer)
 {
     if (IsEditing || IsPreviewing)
     {
         NullModelHelper.RenderNullModelMessage(writer, AppRelativeVirtualPath, DataSource, PresenterFactory.GetPresenter <TModel>().GetType(), typeof(TModel));
     }
 }