G
Guest
Hi
I have a placeholder that has multiple controls that need to be loaded and
rendered to the user based on some user selections. I have to loop through
the choices that the user makes and then load the controls. I am doing this
in the protected override void Render(HtmlTextWriter writer) method.
protected override void Render(HtmlTextWriter writer)
{
foreach (Selection in UsersSelection)
{
switch(Selection)
{
case "Selection 1":
UserControl1 uc1 = Page.LoadControl("Control to be loaded") as UserControl1;
//Set user control properties
Panel.Control.Add(uc1);
case "Selection 2":
UserControl1 uc2 = Page.LoadControl("Control to be loaded") as UserControl1;
//Set user control properties
Panel.Control.Add(uc2);
case "Selection 3":
UserControl1 uc3 = Page.LoadControl("Control to be loaded") as UserControl1;
//Set user control properties
Panel.Control.Add(uc3);
:
:
}
}
base.Render(writer);
}
But I want the page to be displayed as soon as the data from one control has
been obtained. Is there any way to do this ? I tried setting the
Response.Buffer to false and then flushing the results. But what happens is
that all the controls are looped through and then the entire data is shown on
the page at the same time which causes the page to be blank for a some time.
Thanks a lot in advance for any help.
I have a placeholder that has multiple controls that need to be loaded and
rendered to the user based on some user selections. I have to loop through
the choices that the user makes and then load the controls. I am doing this
in the protected override void Render(HtmlTextWriter writer) method.
protected override void Render(HtmlTextWriter writer)
{
foreach (Selection in UsersSelection)
{
switch(Selection)
{
case "Selection 1":
UserControl1 uc1 = Page.LoadControl("Control to be loaded") as UserControl1;
//Set user control properties
Panel.Control.Add(uc1);
case "Selection 2":
UserControl1 uc2 = Page.LoadControl("Control to be loaded") as UserControl1;
//Set user control properties
Panel.Control.Add(uc2);
case "Selection 3":
UserControl1 uc3 = Page.LoadControl("Control to be loaded") as UserControl1;
//Set user control properties
Panel.Control.Add(uc3);
:
:
}
}
base.Render(writer);
}
But I want the page to be displayed as soon as the data from one control has
been obtained. Is there any way to do this ? I tried setting the
Response.Buffer to false and then flushing the results. But what happens is
that all the controls are looped through and then the entire data is shown on
the page at the same time which causes the page to be blank for a some time.
Thanks a lot in advance for any help.