public static void PushContext(this UpdatePanelScope scope) { var panelShouldRender = scope.ShouldRender(); var parentShouldRender = scope.ShouldRenderParent(); var startRendering = parentShouldRender == false && panelShouldRender == true; var endRendering = parentShouldRender == true && panelShouldRender == false; if (startRendering) { scope.Page.PushWriter(scope.RootWriter()); } else if (endRendering) { scope.Page.PushWriter(TextWriter.Null); } }
public static void PopContext(this UpdatePanelScope scope) { var panelShouldRender = scope.ShouldRender(); var parentShouldRender = scope.ShouldRenderParent(); var startRendering = parentShouldRender == false && panelShouldRender == true; var endRendering = parentShouldRender == true && panelShouldRender == false; if (startRendering || endRendering) { //var rootWriter = scope.RootWriter(false); var writer = scope.Page.PopWriter(); //if (writer == rootWriter) //{ // scope.Page.Context.Response.ClearContent(); // scope.Page.Context.Response.Output.Write(rootWriter.GetStringBuilder().ToString()); // scope.Page.Context.Response.Output = TextWriter.Null; //} } }