</asp:Panel>
<script type="text/javascript" language="javascript">
//
// This part is done because that setting focus in code behind with someting like SetFocusOnControl(TextBoxQualifier)
// for some reson does not work when the text box is placed in a Panel that is handled by a CollapsiblePanelExtender.
//
// Also for some reason it does not work to set focus direct in the pageLoad function (but it does work if a alert statement is done after it)
// thats why the setFocus function is called from setTimeout.
//
var objExtender;
function pageLoad(sender, args) {
objExtender = $find("<% =CollapsiblePanelExtender1.ClientID %>");
objExtender.add_expandComplete(setFocus);
objExtender.add_collapseComplete(setFocus);
setTimeout("setFocus()", 10);
}
function setFocus() {
if (!objExtender.get_Collapsed()) {
$get("<%=TextBoxQualifier.ClientID%>").focus();
}
}
</script>
Visar inlägg med etikett AJAX. Visa alla inlägg
Visar inlägg med etikett AJAX. Visa alla inlägg
tisdag 22 maj 2012
torsdag 16 juni 2011
To avoid Ajax time out while debugging
if (Debugger.IsAttached)
{
ScriptManager1.AsyncPostBackTimeout = 500;
}
{
ScriptManager1.AsyncPostBackTimeout = 500;
}
Prenumerera på:
Inlägg (Atom)