ModalPopup 中的 ASP.Net Ajax 组合框
我在 ModalPopupExtender 中有一个组合框,当显示弹出窗口时,项目列表不在文本框下方,而是向右偏移。 我的代码是:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true">
<Services>
</Services>
<Scripts>
<asp:ScriptReference Path="~/JavaScript/ScriptManager.js" />
</Scripts>
</asp:ScriptManager>
<div>
<asp:Panel ID="dialog" runat="server">
<div id="dialogContents">
<asp:ComboBox ID="DropDownListMailTos" runat="server" AutoPostBack="true"
DropDownStyle="DropDown" Width="90%" RenderMode="Block">
<asp:ListItem Text="1" Value="1" />
<asp:ListItem Text="2" Value="2" />
<asp:ListItem Text="3" Value="3" />
</asp:ComboBox>
<br />
<asp:Button ID="btnOK" Text="OK" runat="server" />
</div>
</asp:Panel>
<asp:Button ID="btnShow" Text="Open Dialog" runat="server" />
<asp:ModalPopupExtender
TargetControlID="btnShow"
PopupControlID="dialog"
OkControlID="btnOK"
DropShadow="true"
BackgroundCssClass="modalBackground"
runat="server" />
</div>
但那里没有运气。 我能做什么呢?
I have a combo box inside a ModalPopupExtender and when the popup is showed the list of items is not located under the text box but is offset to the right.
my code is:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true">
<Services>
</Services>
<Scripts>
<asp:ScriptReference Path="~/JavaScript/ScriptManager.js" />
</Scripts>
</asp:ScriptManager>
<div>
<asp:Panel ID="dialog" runat="server">
<div id="dialogContents">
<asp:ComboBox ID="DropDownListMailTos" runat="server" AutoPostBack="true"
DropDownStyle="DropDown" Width="90%" RenderMode="Block">
<asp:ListItem Text="1" Value="1" />
<asp:ListItem Text="2" Value="2" />
<asp:ListItem Text="3" Value="3" />
</asp:ComboBox>
<br />
<asp:Button ID="btnOK" Text="OK" runat="server" />
</div>
</asp:Panel>
<asp:Button ID="btnShow" Text="Open Dialog" runat="server" />
<asp:ModalPopupExtender
TargetControlID="btnShow"
PopupControlID="dialog"
OkControlID="btnOK"
DropShadow="true"
BackgroundCssClass="modalBackground"
runat="server" />
</div>
i tried few solutions found here and here
but no luck there.
What can i do about it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来这里唯一的问题是
ModalPopup
与ComboBox
的默认样式发生冲突。您只需使用应用于ComboBox
中的ListItem
的 CSS 类即可让它们正确显示。将以下代码添加到该页面的 CSS 中(在 IE9、Chrome 和 FireFox 中测试),您应该会很好:有关详细信息,请参阅 文档页面。
It looks like the only problem here is that the
ModalPopup
is clashing with the default styling of theComboBox
. You just need to play around with the CSS class that's applied to theListItem
s in theComboBox
to get them to show up right. Add the following code to your CSS for that page (tested in IE9, Chrome, and FireFox) and you should be good:For more information, see the section on "Combo Box Theming" at the bottom of the documentation page.