UpdatePanel updating all controls after the execution is over
I am using update panel and few controls. I want the controls to be displayed as and when they are populated in the code. But what happens is, all the controls are displayed with data at the end( after entire processing is done).
EDIT开发者_开发技巧: Can it be achieved without using seperate update panels for each control?
Is there any way around this to work?
Thanks.
In order to accomplish this, you'll have to split up each control into it's own update panel and have each update panel load independently after the page itself loads. Take a look at the example here.
The reason controls aren't displayed as soon as they are populated in the code behind is because at that point the request hasn't been fully processed and the data hasn't been sent to the client (yet). The data isn't sent to the client yet because you might set some of those controls' Visible
property to false
later in your code and that markup won't need to be sent out at all. ASP.NET doesn't know that until it has finished processing the request.
Hopefully that makes it a little clear as to why what you're trying to do is in conflict with how ASP.NET WebForms work. You should take the time to read over and understand the page life cycle.
精彩评论