Thanks, that is exactly what I was looking for. And the extra threads are helpful too. But if I put the panel in a master page, it no longer works:
MasterPage:---------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
.aspx-----------------------------------------------------------------
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %>
<%@ Register Src="focusTextBox.ascx" TagName="FocusTextBox" TagPrefix="uc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
function pageLoad()
{ //find the PopupControlExtender's client behavior
var pce = $find("pce"); //add the shown event handler
pce.add_shown(pceShownHandler);
}
function pceShownHandler(sender, args)
{
var pce = $find("pce"); //find the popup Panel of the PopupControlExtender
var popup = pce._popupElement;
var input = popup.getElementsByTagName("input");
for (i = 0; i < input.length; i++)
{ // To check whether the TextBox is the "setFocusToMeOnPopup".
// This is just a sample, please modify this condition yourself.
if (input[i].id == "FocusTextBox1_setFocusToMeOnPopup")
{
input[i].focus();
input[i].select();
}
}
}
</script>
<asp:TextBox runat="server" ID="tbPrompt" Text="Click here to display popup ..." />
<hr />
<asp:Panel
ID="popupPanel"
runat="server"
BackColor="#99FF66"
Height="100px"
HorizontalAlign="Center"
Width="327px"
Style="display: none">
<br />
The Popup Panel.
<br />
<uc1:FocusTextBox ID="FocusTextBox1" runat="server" />
</asp:Panel>
</div>
<AjaxControlToolkit:PopupControlExtender
ID="TextBox1_PopupControlExtender"
BehaviorID="pce"
runat="server"
TargetControlID="tbPrompt"
PopupControlID="popupPanel"
Position="Bottom"> </AjaxControlToolkit:PopupControlExtender>
</asp:Content>
.ascx--------------------------------------------------------------------
<%@ Control Language="C#" ClassName="focusTextBox" AutoEventWireup="false" %>
<asp:TextBox ID="setFocusToMeOnPopup" runat="server"></asp:TextBox>