The tab container ondemand doesn't play nice with the AutoCompleteExtender.
Somehow the tab renders before the javascript can. Leaving the autocompleteextender useless on the page.
```
<script type="text/javascript">
function item_selected_Permissions(sender, e) {
var HiddenFieldUserPerms = $get('<%= HiddenFieldUserPerms.ClientID %>');
HiddenFieldUserPerms.value = e.get_value();
}
</script>
<asp:TabContainer ID="TabContainer1" runat="server" Width="950px" OnDemand="true">
<asp:TabPanel ID="TabPanel2" runat="server" ToolTip="" HeaderText="Search" OnDemandMode="Once">
<ContentTemplate>
<asp:TextBox ID="txtUserName" runat="server" Width="350"></asp:TextBox>
<asp:AutoCompleteExtender ID="txtUserName_AutoCompleteExtender" runat="server" CompletionInterval="10" DelimiterCharacters="" Enabled="True" MinimumPrefixLength="1" ServiceMethod="GetUsers" ServicePath="~/MyWebservice.asmx" TargetControlID="txtUserName" FirstRowSelected="True" OnClientItemSelected="item_selected_Permissions" CompletionSetCount="20" UseContextKey="True">
</asp:AutoCompleteExtender>
<asp:HiddenField ID="HiddenFieldUserPerms" runat="server" />
<asp:Label ID="lblinvaliduser" runat="server" ForeColor="Red" Text="Please select a user from the suggestion list"
Visible="false"></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidatorUserID" runat="server" ControlToValidate="txtUserName"
ErrorMessage="*" ValidationGroup="user"></asp:RequiredFieldValidator>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
```
Somehow the tab renders before the javascript can. Leaving the autocompleteextender useless on the page.
```
<script type="text/javascript">
function item_selected_Permissions(sender, e) {
var HiddenFieldUserPerms = $get('<%= HiddenFieldUserPerms.ClientID %>');
HiddenFieldUserPerms.value = e.get_value();
}
</script>
<asp:TabContainer ID="TabContainer1" runat="server" Width="950px" OnDemand="true">
<asp:TabPanel ID="TabPanel2" runat="server" ToolTip="" HeaderText="Search" OnDemandMode="Once">
<ContentTemplate>
<asp:TextBox ID="txtUserName" runat="server" Width="350"></asp:TextBox>
<asp:AutoCompleteExtender ID="txtUserName_AutoCompleteExtender" runat="server" CompletionInterval="10" DelimiterCharacters="" Enabled="True" MinimumPrefixLength="1" ServiceMethod="GetUsers" ServicePath="~/MyWebservice.asmx" TargetControlID="txtUserName" FirstRowSelected="True" OnClientItemSelected="item_selected_Permissions" CompletionSetCount="20" UseContextKey="True">
</asp:AutoCompleteExtender>
<asp:HiddenField ID="HiddenFieldUserPerms" runat="server" />
<asp:Label ID="lblinvaliduser" runat="server" ForeColor="Red" Text="Please select a user from the suggestion list"
Visible="false"></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidatorUserID" runat="server" ControlToValidate="txtUserName"
ErrorMessage="*" ValidationGroup="user"></asp:RequiredFieldValidator>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
```