DropDown List消除了中间空间 [英] DropDown List eliminate intermediate spaces

查看:43
本文介绍了DropDown List消除了中间空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我正在使用下拉列表网页控件。这个下拉列表有一个问题

我想展示的一些描述。


描述是XXX JJJ,但它显示在浏览器XXX JJJ (它

隐藏了一些空格)。


我试着编码它用& nbsp;替换空格但是下拉列表

组件替换de&与& amp;这是一个灾难。


我不想改变下拉列表的网页表单,任何想法???


任何想法解决这个问题?


谢谢,

Pablo Difrieri。

Hello,

I''m using a dropdownlist web control. This dropdownlist has a problem with
some descriptions I''d like to show.

The description is "XXX JJJ", but it shows in the browser "XXX JJJ" (it
hides some spaces).

I tryed to encode it replacing the blanks with   but the dropdownlist
component replace de & with "&" and it makes a desaster.

I don''t want to change the dropdownlist web form, any idea???

Any idea to solve this problem?

Thanks,

Pablo Difrieri.

推荐答案

你好卢卡斯,


请手动将HTML代码更改为以下代码片段并再次测试
此问题。它适用于我。

...

< asp:dropdownlist id =" DropDownList1" style =" Z-INDEX:102;左:288px;

位置:绝对; TOP:64px"

runat =" server"高度= QUOT; 120像素" Width =" 208px">

< asp:ListItem Value =" Test1"

Selected =" True"> XXX& nbsp;& nbsp ;& nbsp;& nbsp;& nbsp; J JJ< / asp:ListItem>

< asp:ListItem Value =" test2"> test2< / asp:ListItem>

< / asp:dropdownlist>< / FONT>< / form>

...

它能回答你的问题吗?如果我误解了你的顾虑,请

随时告诉我。


祝你好运,


Jacob Yang

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

发布是按原样提供的。没有保证,也没有授予任何权利。

Hi Lucas,

Please change the HTML code manually to the following code snippet and test
this issue again. It works on my side.
...
<asp:dropdownlist id="DropDownList1" style="Z-INDEX: 102; LEFT: 288px;
POSITION: absolute; TOP: 64px"
runat="server" Height="120px" Width="208px">
<asp:ListItem Value="Test1"
Selected="True">XXX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;J JJ</asp:ListItem>
<asp:ListItem Value="test2">test2</asp:ListItem>
</asp:dropdownlist></FONT></form>
...
Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


我们测试了它,它在浏览器中显示正常。问题是我们

正在使用绑定到数据集的下拉列表,因此难以拦截渲染中的
(我们认为很难在所有这些中进行)我们的

下拉列表控件)。


假设我们取消绑定控件并手动添加项目,我们想使用

代码隐藏来做它(你可以在附件文件中得到它),因为它是我们必须应用的标准的一部分




DropDownList1.Items。添加(新的ListItem(" XXX& nbsp;& nbsp;& nbsp;& nbsp;& nbsp; JJJ",

" Test1"))

DropDownList1.Items.Add(New ListItem(" XXX& nbsp;& nbsp;& nbsp; JJJ"," Test2"))


DropDownList1.Items。添加(New ListItem(" PPP JJJ"," Test3"))

DropDownList1.Items.Add(New ListItem(" PPP JJJ"," Test4")))


通过这种方式,前两个元素对&编码; NBSP;并向他们展示

字面意思。后两个元素消除了额外的空间。


这个问题的任何解决方案?

最好的解决方案是IE不会消除中间空白

空格。其他只是解决方法。


非常感谢。


Pablo Difrieri


" Jacob Yang [MSFT]" <ジ*** @ online.microsoft.com> escribióenel mensaje

新闻:Hl ************** @ cpmsftngxa06.phx.gbl ...
We had test it and it is shown fine in the browser. The problem is that we
are using the dropdownlist binded to a Dataset, so is difficult to intercept
the render (and we think it could be difficult to do it in all our
dropdownlist controls).

Supposing we unbind the control and add items manually, we''d like to use
codebehind to do it (you can get it in the attach file) because it is part
of the standard we have to apply.

DropDownList1.Items.Add(New ListItem("XXX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JJJ",
"Test1"))
DropDownList1.Items.Add(New ListItem("XXX&nbsp;&nbsp;&nbsp;JJJ", "Test2"))

DropDownList1.Items.Add(New ListItem("PPP JJJ", "Test3"))

DropDownList1.Items.Add(New ListItem("PPP JJJ", "Test4"))

In this way, the first two elements encode the &nbsp; and show them
literally. The second two elements eliminates additional spaces.

Any solution to this problem?
The best solution would be that IE doesn''t eliminates intermediate blank
spaces. The others are just workarounds.

Thanks a lot.

Pablo Difrieri

"Jacob Yang [MSFT]" <ji***@online.microsoft.com> escribió en el mensaje
news:Hl**************@cpmsftngxa06.phx.gbl...
嗨卢卡斯,

请手动将HTML代码更改为以下代码段,
再次测试此问题。它适用于我。
..
< asp:dropdownlist id =" DropDownList1" style =" Z-INDEX:102;左:288px;
位置:绝对; TOP:64px"
runat =" server"高度= QUOT; 120像素" Width =" 208px">
< asp:ListItem Value =" Test1"
Selected =" True"> XXX& nbsp;& nbsp;& nbsp;& nbsp ;& nbsp; J JJ< / asp:ListItem>
< asp:ListItem Value =" test2"> test2< / asp:ListItem>
< / asp:dropdownlist>< / FONT>< / form>
..
它能回答你的问题吗?如果我误解了您的疑虑,请随时告诉我。

致以诚挚的问候,

Jacob Yang
Microsoft在线合作伙伴支持 www.microsoft.com/security
此帖子提供 按原样没有保证,也没有赋予任何权利。
Hi Lucas,

Please change the HTML code manually to the following code snippet and test this issue again. It works on my side.
..
<asp:dropdownlist id="DropDownList1" style="Z-INDEX: 102; LEFT: 288px;
POSITION: absolute; TOP: 64px"
runat="server" Height="120px" Width="208px">
<asp:ListItem Value="Test1"
Selected="True">XXX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;J JJ</asp:ListItem>
<asp:ListItem Value="test2">test2</asp:ListItem>
</asp:dropdownlist></FONT></form>
..
Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.








你好卢卡斯,


请尝试下面的代码。

...

将myWriter作为新StringWriter调暗

将myString作为字符串调暗

HttpUtility.HtmlDecode(" PPP JJJ",

myWriter)

myString = myWriter.ToString()

DropDownList1.Items.Add(New ListItem(myString," Test3"))

...


它能回答你的问题吗?如果我误解了你的顾虑,请

随时告诉我。


祝你好运,


Jacob Yang

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

发布是按原样提供的。没有保证,也没有赋予任何权利。

Hi Lucas,

Please try the following code on your side.
...
Dim myWriter As New StringWriter
Dim myString As String
HttpUtility.HtmlDecode("PPP     JJJ",
myWriter)

myString = myWriter.ToString()
DropDownList1.Items.Add(New ListItem(myString, "Test3"))
...

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


这篇关于DropDown List消除了中间空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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