将值从gridview传递到文本框时出现问题 [英] Issue in passing value from gridview to textbox

查看:53
本文介绍了将值从gridview传递到文本框时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gridview列值中有一个名字D'Souza

I have a name in a gridview column value "D'Souza"

txt_name.Text = row.Cells[4].Text;



返还值


its returning the value

D'Souza

而不是

"D'Souza"



请帮我在文本框中找到正确的名称


please help me to get the proper name in textbox

推荐答案

嗨Sathish,



这个问题很常见,您需要使用像这样的HttpUtility解码值

Hi Sathish,

This issues are common, you need to decode the value using HttpUtility like this
string outputstr = HttpUtility.HtmlDecode(row.Cells[4].Text);
txt_name.Text = outputstr;

or

txt_name.Text = HttpUtility.HtmlDecode(row.Cells[4].Text);



希望这对你有所帮助。



问候,

RK


Hope this helps you a bit.

Regards,
RK


这篇关于将值从gridview传递到文本框时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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