views:

160

answers:

1

On aspx page I have a PlaceHolder that is inside Updatepanel.

I am creating nested-repeaters on runtime:

protected void Page_Init(object sender, EventArgs e)
{       
        CreateRepeater(PlaceHolder1, 0);
        Repeater repeater1 = (Repeater)PlaceHolder1.FindControl("Repeater1");

        if (repeater1 != null)        
            BindDataToRepeater(repeater1, 0);
            /*Each repeater creates another repeater(if needed)
              in repeater_ItemCreated event and binds it to data
              in repeater_ItemDataBound event
            */          
}

In repeater_ItemCommand event, after preforming an action (like deletion) i need to recreate and rebind the repeaters for changes to appear. What I do now is:

   Page.Response.Redirect(Page.Request.Url.ToString(), true);

Is there a better way to do so? Using UpdatePanel?

Or maybe another way?

+1  A: 

I think you just need to call Repeater1.DataBind() in your Delete event handler to refresh the controls.

DancesWithBamboo
This should rebind or nested controls as well?
markiz
I think it works!
markiz