you can add an event handler to the ModalPopup showing event and set the focus with a javascript function. Add this script to your page:
<script type="text/javascript">
Sys.Application.add_load(modalSetup);
function SetFocusOnControl()
{
// set the focus with javascript, e.g.: window.getElementById("xyz").focus();
}
function modalSetup()
{
var modalPopup = $find('ModalDialogTest'); // <. this is the BehaviorID from the ModalPopupExtender
modalPopup.add_showing(SetFocusOnControl);
}
Zhou
Participant
1428 Points
266 Posts
Re: Set Focus on Textbox in modalPopup Panel
May 18, 2007 10:16 AM|LINK
Hi,
you can add an event handler to the ModalPopup showing event and set the focus with a javascript function. Add this script to your page:
<script type="text/javascript">
Sys.Application.add_load(modalSetup);
function SetFocusOnControl()
{
// set the focus with javascript, e.g.: window.getElementById("xyz").focus();
}
function modalSetup()
{
var modalPopup = $find('ModalDialogTest'); // <. this is the BehaviorID from the ModalPopupExtender
modalPopup.add_showing(SetFocusOnControl);
}
</script>
Regards
Marc André