开发者

AjaxControlToolkit:ModalPopupExtender not working at second attempt

I have created a user control which contains an ImageButton.

Upon clicking this ImageButton I open an AjaxControlToolkit:ModalPopupExt开发者_如何学Goender.

When I run this VB.NET application and click on the ImageButton the .modalBackground CSS is loaded, but when I close the ModalPopupExtender and again click on the ImageButton, on the second load the .modalBackground CSS is not working.

.modalBackground
{   
    BACKGROUND-COLOR: gray;
    filter: alpha(opacity=70);      
    opacity: 0.7;     
}


I had that kind of problem, it was caused by storing a reference to the popup control in a session. The solution was to recursively find the popup control by looking in all parent controls:

private T FindParentControl<T>( T control )
    where T : class
{
    if( control.Parent is T )
    {
        return control.Parent as T;
    }
    return control.Parent != null ? FindParentControl( control.Parent ) : null;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜