/// <summary> /// Starts UpdatePanel container /// </summary> /// <param name="panel"></param> /// <param name="config">Optional configuration</param> /// <returns></returns> public static UpdatePanelScope BeginUpdatePanel(this AjaxHelper helper, Action <UpdatePanelSettings> config = null) { if (!IsFilterRegistered()) { throw new InvalidOperationException("UpdatePanelFilter must be registered in GlobalFilters"); } //throw new NotImplementedException(); var settings = new UpdatePanelSettings(); if (config != null) { config(settings); } var panel = new UpdatePanelScope(helper.GetViewPage(), settings); panel.Page.UpdatePanelsStack().Push(panel); var siblings = panel.SiblingsList(); siblings.Add(panel); var html = _UpdatePanelTemplate_cshtml.BeginUpdatePanel(panel); html.WriteTo(panel.Page.Output); panel.PushContext(); return(panel); }
/// <summary> /// Starts UpdatePanel container /// </summary> /// <param name="panel"></param> /// <param name="config">Optional configuration</param> /// <returns></returns> public static UpdatePanelScope BeginUpdatePanel(this AjaxHelper helper, Action<UpdatePanelSettings> config = null) { if (!IsFilterRegistered()) throw new InvalidOperationException("UpdatePanelFilter must be registered in GlobalFilters"); //throw new NotImplementedException(); var settings = new UpdatePanelSettings(); if (config != null) config(settings); var panel = new UpdatePanelScope(helper.GetViewPage(), settings); panel.Page.UpdatePanelsStack().Push(panel); var siblings = panel.SiblingsList(); siblings.Add(panel); var html = _UpdatePanelTemplate_cshtml.BeginUpdatePanel(panel); html.WriteTo(panel.Page.Output); panel.PushContext(); return panel; }
public UpdatePanelScope(WebViewPage page, UpdatePanelSettings settings) { this.page = page; this.Settings = settings; }