Question : Set focus when AJAX modal popup extender closes

Experts,

I need assistance when a Modal Popup Extender closes. There is a "close" button on the Extender. When the extender closes I would like focus to be set to a control on the web form. It seems like it should be easy but I can't get it to work.

Any help is appreciated.

Thank you.

Answer : Set focus when AJAX modal popup extender closes

if textbox is asp.net server control then this will not work... as after rendering textbox id will become different.

document.getElementById("txtLastOptOutDate").focus();

instead try this:

document.getElementById('<%=txtLastOptOutDate.ClientID%>').focus();
Random Solutions  
 
programming4us programming4us