我有以下模式弹出扩展程序:
<asp:Label ID="lbl" runat="server"></asp:Label>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lbl"
PopupControlID="PnlUpdate" BackgroundCssClass="modalBackground" >
</asp:ModalPopupExtender>
<asp:Panel ID="PnlUpdate" runat="server" Width="500px" CssClass="popup" Height="500px" >
<asp:UpdatePanel ID="UpnlModal" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table width="100%">
<tr>
<td align="right">
<table width="100%" align="center">
<tr>
<td class="Heading" align="center">
<asp:Label ID="lblHeading" runat="server"></asp:Label>
</td>
</tr>
</table>
<table align="center" width="70%">
<tr>
<td align="right" class="NormalText">
<asp:DataList ID="dlMovies" runat="server" RepeatDirection="Horizontal" RepeatColumns="1"
Width="100%">
<ItemTemplate>
<table align="center" width="70%">
<tr>
<td align="left">
<asp:Label ID="lblMovieName" runat="server"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
我想要它的scollbar。
我提到How can I make the modal popup scroll its contents with the page?并将css设为:
.modalBackground
{
overflow : auto ;
background-color:Black ;
filter:alpha(opacity=65);
-moz-opacity:0.65;
Opacity:0.65;
}
但仍然没有滚动条,(我还提到了Height =“500px”面板。
请帮帮我。
答案 0 :(得分:5)
您可以将面板内容包含在具有max-height和overflow:auto
的div中<asp:Panel ID="PnlUpdate" runat="server" Width="500px" CssClass="popup" Height="500px" >
<div id="Div1" runat="server" style="max-height: 500px; overflow: auto;">
PANEL CONTENTS
</div>
</asp:Panel>
答案 1 :(得分:1)
您应该将CSS属性提供给'popup'css类。使用下面给出的类
.popup {overflow : auto ; height: 500px; }