同花順,我想使用某種逐步呈現在三夏,這裏有一個例子(沒有工作像預想的那樣)使用響應中的WebControl
public class Price : WebControl
{
protected override void Render(HtmlTextWriter output)
{
HttpResponseBase response = new HttpResponseWrapper(new HttpResponse(output));
//Panel basePanel = new Panel() { ID = "basePanel" };
//Controls.Add(basePanel);
//var loaderImage = LoaderAnimation();
//Controls.Add(loaderImage);
System.Threading.Thread.Sleep(500);
Controls.Add(new LiteralControl("aaa "));
response.Flush();
System.Threading.Thread.Sleep(500);
Controls.Add(new LiteralControl("bbb "));
response.Flush();
System.Threading.Thread.Sleep(500);
Controls.Add(new LiteralControl("ccc "));
base.RenderContents(output);
}
}
這應該在每次刷新渲染。也許這是一個可怕的技術,但我愛這個建議。