Showing posts with label Updatepanel Lightbox. Show all posts
Showing posts with label Updatepanel Lightbox. Show all posts

Thursday, September 23, 2010

Lightbox won't work after updatepanel reloads

If you control is in an UpdatePanel you need to reinitialize lightbox after your asyncpostback.


protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//Normal page load logic here..
}
else
{
//Reinitialize lightbox on postback.
ScriptManager.RegisterStartupScript(Page, typeof(Page), "init", "initLightbox();", true);
}
}