如何处理在ASP.NET DropDownList控件长文本 [英] how to handle long text in dropdownlist control in ASP.NET

查看:302
本文介绍了如何处理在ASP.NET DropDownList控件长文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/586718/recommendations-for-dropdown-menu-items-that-are-too-wide\">Recommendations对于下拉菜单项是太宽?

我有一个由数据库pouplated 1下拉列表。它的价值费尔德包含记录ID和选项费尔德包含记录的文字。但记录文本输入很长,让我的下拉这么长时间,它完全chnage我的网页的前景。当我砍倒的宽度也减少显示的文本。是否有我的网页上也看起来不错,用户可以看到全文,以及像包木窗的文本或滚动之类的任何事物的任何选项...

i have one dropdown list which is pouplated by database . Its value feild contain records id and option feild contain the text of record . But the record text entries are very long and makes my dropdown so long that it totally chnage the outlook of my webpage. when i cut down the width it also cut down the text displayed . Is there any option that my webpage also looks good and user can see the full text as well like Wraping text or scroll or any thing like that...

如何处理这个......请帮助我

how to handle this ... please help me

推荐答案

尝试使用CSS来固定宽度添加到您的下拉列表中,这样的:

Try using CSS to add a fixed width to your dropdown, like:

select {width: 150px}

虽然下拉本身将是一个固定的宽度,并且可能不会显示所有的文字,选择元素应扩大到最宽元素的宽度。

Whilst the dropdown itself will be of a fixed width and may not show all of the text, the option elements should expand to the width of the widest element.

可能无法在IE7工作及以下,在这种情况下的此链接可能会有一些使用这些浏览器:

May not work in IE7 and below, in which case the this link may be of some use for those browsers:

这篇关于如何处理在ASP.NET DropDownList控件长文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆