Thank you for your post. I began stripping items out until I figured out what was causing the problem. I am using a master page, and a DIV element in that master page is using relative positioning. When I remove the position part of that DIV tag, there is no problem with the autocomplete list. When I put it back, the dropdownlist is popping back up in the middle of the list. But of course I can't just remove that DIV style as it's on the master page and is important to the site. I have tried a few things but can't seem to fix this (while using the master page). Please see my code below. Thanks for any ideas.
Here's my store.aspx file:
<%@ Page Language="VB" MasterPageFile="~/themaster.master" EnableViewStateMac="false" AutoEventWireup="false" CodeFile="test.aspx.vb" MaintainScrollPositionOnPostback="true" Inherits="test" Title="test page" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contentBody" runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="AutoCompletes.asmx" />
</Services>
</asp:ScriptManager>
<asp:HiddenField ID="hdnSelectedItem" runat="server" />
<asp:Label ID="lblHiddenProceed" runat="server" Visible="False"></asp:Label>
<asp:MultiView ID="mvMain" runat="server" ActiveViewIndex="0">
<asp:View ID="vwSearch" runat="server">
</asp:View>
<asp:View ID="vwStoreLocation" runat="server">
<asp:SqlDataSource ID="sqlStoreType" runat="server" ConnectionString="<%$ ConnectionStrings:theconnectionstring %>"
SelectCommand="SELECT * from StoreLocType">
</asp:SqlDataSource>
<asp:SqlDataSource ID="sqlStoreLocDetail" runat="server" OldValuesParameterFormatString="original_{0}" ConnectionString="<%$ ConnectionStrings:theconnectionstring %>"
DeleteCommand="DeleteStoreLocation" DeleteCommandType="StoredProcedure"
InsertCommand="InsertStoreLocInfo" InsertCommandType="StoredProcedure"
SelectCommand="SELECT StoreLocInfo.*, Stores.code AS Storecode, Stores.name AS Storename FROM [StoreLocInfo] LEFT OUTER JOIN [Stores] on StoreLocInfo.Store = Stores.ident WHERE(StoreLocInfo.[ident] = @ident)"
UpdateCommand="UPDATE [StoreLocInfo] SET [Store] = @Store, [alias1] = @alias1, [alias2] = @alias2, [type] = @type">
<SelectParameters><asp:ControlParameter ControlID="hdnSelectedItem" Name="ident" PropertyName="Value" Type="Int32" /></SelectParameters> <DeleteParameters>
<asp:Parameter Name="original_ident" Type="Int32" />
<asp:Parameter Name="original_mstamp" Type="DateTime" />
<asp:Parameter Name="stampu" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Store" Type="Int32" />
<asp:Parameter Name="type" Type="String" />
<asp:Parameter Name="alias1" Type="String" />
<asp:Parameter Name="alias2" Type="String" />
<asp:Parameter Name="original_mstamp" Type="datetime"/>
<asp:Parameter Name="original_ident" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Store" Type="Int32" />
<asp:Parameter Name="type" Type="String" />
<asp:Parameter Name="alias1" Type="String" />
<asp:Parameter Name="alias2" Type="String" />
<asp:Parameter Name="newid" Type="int32" Direction="returnvalue" />
</InsertParameters>
</asp:SqlDataSource>
<br />
<asp:FormView ID="fvStoreLoc" runat="server" DefaultMode="Edit" DataKeyNames="ident,mstamp" DataSourceID="sqlStoreLocDetail">
<EmptyDataTemplate>
<p style="font-family:Verdana;font-size:.8em;font-weight:normal;width:100%;text-align:left">
<br />
<a style="font-size:larger;font-weight:bold">No Record Selected
</p>
</EmptyDataTemplate>
<EditItemTemplate>
</EditItemTemplate>
<InsertItemTemplate>
<td style="vertical-align:top; width:260px">
<asp:UpdatePanel ID="UpdatePanel5" runat="server">
<ContentTemplate>
<a class="TextLabel">Store Code</a>
<asp:RequiredFieldValidator ID="reqtxtStoreCode" runat="Server" ControlToValidate="txtStoreCode" ErrorMessage="*required" ForeColor="Red" /><br />
<asp:TextBox ID="txtStoreCode" runat="server" Width="40px" MaxLength="4" AutoPostBack="True"></asp:TextBox><br />
</ContentTemplate>
<triggers>
<asp:AsyncPostBackTrigger ControlID="txtStoreCode"></asp:AsyncPostBackTrigger>
</triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel6" runat="server">
<ContentTemplate>
<a class="TextLabel">Store Name</a>
<asp:HiddenField ID="hdnStoreIdent" runat="server" Value='<%# Bind("Store") %>' /><br />
<asp:TextBox ID="txtStoreName" runat="server" Width="200px" MaxLength="60" AutoPostBack="True"></asp:TextBox><br />
<cc1:AutoCompleteExtender ID="autoStoreName" runat="server" TargetControlID="txtStoreName" ServicePath="AutoComplete.asmx" ServiceMethod="GetStoreNames"
MinimumPrefixLength="1" EnableCaching="true" OnClientShowing="clientShowing"/>
</ContentTemplate>
<triggers>
<asp:AsyncPostBackTrigger ControlID="txtStoreName"></asp:AsyncPostBackTrigger>
</triggers>
</asp:UpdatePanel>
<a class="TextLabel">Location Alias(es)</a><br />
<asp:TextBox ID="txtAlias1" runat="server" Width="200px" MaxLength="60" Text='<%# Bind("alias1") %>'></asp:TextBox><br />
<asp:TextBox ID="txtAlias2" runat="server" width="200px" MaxLength="60" Text='<%# Bind("alias2") %>'></asp:TextBox><br />
<a class="TextLabel">Type</a><asp:RequiredFieldValidator ID="reqType" runat="server" ControlToValidate="cboStoreType" ErrorMessage="*required" Display="dynamic"> </asp:RequiredFieldValidator><br />
<asp:DropDownList ID="cboStoreType" runat="server" AppendDataBoundItems="true"
DataSourceID="sqlType" DataTextField="type" DataValueField="ident" SelectedValue='<%# Bind("type") %>'>
<asp:ListItem Value="">Not Entered</asp:ListItem>
</asp:DropDownList><br />
</td>
</InsertItemTemplate>
</asp:FormView>
</asp:View>
</asp:MultiView>
</asp:Content>
'Here's the codebehind:
Imports System.Data.sqlClient
Imports System.Security.Principal
Imports System.Web.Script.Services
Imports System.Web.Script.Services.ScriptServiceAttribute
Partial Class test
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.mvMain.ActiveViewIndex = 1
fvStoreLoc.ChangeMode(FormViewMode.Insert)
End Sub
End Class
And here's my themaster.master file (the code behind is blank)
When I remove the following snippet, everything is fine (but i need it to remain):
position:relative;top:10px;width:803px;height:auto;
<%@ Master Language="VB" CodeFile="themaster.master.vb" Inherits="themaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
</head>
<body style="width:100%;text-align:center;background-color:#666699">
<form id="frmMain" runat="server">
<div id="mainDiv" style="position:relative;top:10px;width:803px;height:auto; background-color:white;border:solid 1px #666666">
<div id="contentDiv" >
<div >
<asp:ContentPlaceHolder ID="contentBody" runat="server"></asp:ContentPlaceHolder>
</div>
</div>
</div>
</form>
</body>
</html>