2013-04-17 42 views
0

我有文本框,我想要它時,我開始輸入自動完成將顯示建議。這是我的html代碼在asp.net(vb)中控制ajax工具包自動完成的高度

<tr> 
    <td valign="top" align="right"> 
     <asp:Label ID="labelPayableAccount" runat="server" CssClass="ItemTitle" Text="Payable Account"></asp:Label> 
    </td> 
    <td valign="top" align="center" class="style2"> 
     <asp:Label ID="labelPayableAccountColon" runat="server" CssClass="ItemTitle" Text=":"></asp:Label> 
    </td> 
    <td valign="top" align="left"> 
     <asp:TextBox ID="txtPayableAccount" runat="server" Width="400px" CssClass="textBoxString"></asp:TextBox> 
    <div id="divwidth1"> 
    </div> 

<ajaxToolkit:AutoCompleteExtender ID="autoComplete1" runat="server" EnableCaching="true" 
    BehaviorID="AutoCompleteEx" MinimumPrefixLength="1" TargetControlID="txtPayableAccount" 
    CompletionListElementID="divwidth1" CompletionListCssClass="AutoExtender" CompletionListItemCssClass="AutoExtenderList" 
    CompletionListHighlightedItemCssClass="AutoExtenderHighlight" ServicePath="AutoComplete.asmx" 
    ServiceMethod="GetCompletionListPayableAccount" CompletionSetCount="20" CompletionInterval="1" 
    DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="false"> 
</ajaxToolkit:AutoCompleteExtender> 

<asp:RequiredFieldValidator ID="RequiredFieldValidatortxtPayableAccount" runat="server" 
    ErrorMessage="Required !" ControlToValidate="txtSupplierType"> 
</asp:RequiredFieldValidator> 
</td> 
</tr> 

,這是自動完成佈局的CSS代碼

.AutoExtender 
{ 
    font-family: Verdana, Helvetica, sans-serif; 
    font-size: .8em; 
    font-weight: normal; 
    border: solid 1px #006699; 
    line-height: 20px; 
    padding: 10px; 
    background-color: White; 
    margin-left: 10px; 
    max-height:180px; 
} 
.AutoExtenderList 
{ 
    border-bottom: dotted 1px #006699; 
    cursor: pointer; 
    color: Maroon; 
} 
.AutoExtenderHighlight 
{ 
    color: White; 
    background-color: #006699; 
    cursor: pointer; 
} 
#divwidth1 
{ 
    width: auto !important; 
    height:180px !important; 
} 
#divwidth1 div 
{ 
    width: auto !important; 
} 

我有設計的佈局,使自動完成框架的高度是180像素,但名單不會做同樣的,這裏是快照

enter image description here

任何人可以幫助我嗎?

回答

0

也許嘗試添加溢出CSS屬性?

#divwidth1 
{ 
    width: auto !important; 
    height:180px !important; 

    **overflow: hidden;** 
}