本文介绍了ASP:Label呈现Marathi语言内容的奇怪行为.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我正在开发一个Web应用程序(使用Marathi语言),在其中使用了asp:label,并且在该标签中我想显示一些使用Marathi语言的内容.

就像用英语将内容存储在数据库中一样,当我从数据库加载数据并将其插入asp:label时,它将转换帖子内容<".符号作为html标签.因此,它仅呈现文本部分的一半.

请查看以下代码,在我的asp:label中,我为其分配了marathi文本.但是它将部分渲染为< e"> 符号

Dear Friends,

I am developing a web application (In Marathi Language) in which i used a asp:label and in that label i want to display some content which is in Marathi language.

As am storing the content in database in English language and when i load data from database and insert into asp:label it converts the post content of "<" symbol as html tag. So it renders only half of the text part.

Please see the following code where in my asp:label i have assigned a marathi text to it. But it renders the part upto "<e"> symbol

<asp:Label ID ="lblpbkTest" runat="server" class="headerLblColor" Text="efJeMes<ekeÀe³e&keÀejer DeefOekeÀejer"></asp:Label>



当我删除或在<"之间插入空格和"e"可以正确呈现内容



and when i remove OR insert a space between "<" and "e" it renders the content properly

<asp:Label ID ="lblpbkTest" runat="server" class="headerLblColor" Text="efJeMes< ekeÀe³e&keÀejer DeefOekeÀejer"></asp:Label>



但要留出空格或删除<"更改内容(上下文)的含义.

谁能帮助我解决此问题.

在此先感谢:-)
Shailesh J.



but giving a space or removing "<" change the meaning of the content(context).

Can anybody help me to resolve this issue.

Thanks in advance :-)
Shailesh J.

推荐答案

string teststring = "efJeMes<ekeÀe³e&keÀejer DeefOekeÀejer";
            using (Label testlabel = new Label())
            {
                testlabel.Text = Server.HtmlEncode(teststring);
                Controls.Add(testlabel);
            }


这篇关于ASP:Label呈现Marathi语言内容的奇怪行为.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 10:30