asp.net填充文本框的问题。 [英] Problem with asp.net filling textbox.

查看:75
本文介绍了asp.net填充文本框的问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我是学生。



我正在实施一个申请使用ASP.NET,当我用gridview数据填充文本框时,我收到一个错误。请看下面:



Hi everybody,

I'm a student.

I'm implementing a application using ASP.NET and I get an error when I fill textbox with data of gridview. Please see below:

//row as GridViewRow.
txtOperatorName.Text = row.Cells[2].Text;





我选择的GridviewRow有值LêThánhTiên(越南名字),但它变成了Lê Thá nh Ti&#234 ; n'(在'&'和'#'之间没有间距)我填写的文本框中。请告诉我这里有什么问题以及如何解决它...



我的英语很糟糕,如果它让你感到不舒服,我很抱歉。



非常感谢...



The GridviewRow I select have value "Lê Thánh Tiên" (Vietnamese name) but it's become "L& #234; Th& #225;nh Ti& #234;n" (no spacing between '&' and '#') in the textbox I fill in. Please tell me what problem here and how to fix it...

My English is bad and I sorry if it make you uncomfortable.

Many thanks...

推荐答案

谢谢,@ syed shanu。



这个问题通过以下添加来解决:

Thanks, @syed shanu.

This problem is fixed by adding like below:
Server.HtmlDecode(row.Cells[2].Text);





你可以看到这里



希望对我这样的问题有用。



You can see here.

Hope it's useful for who get same problem like me.


txtOperatorName.Text = GridView1.Rows[1].Cells[2].Text.ToString();





如果解决,请接受。谢谢



If solve please accept. thank you


这篇关于asp.net填充文本框的问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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