Click here to Skip to main content
15,916,180 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a name in a gridview column value "D'Souza"
txt_name.Text = row.Cells[4].Text;

its returning the value
D'Souza
instead of
"D'Souza"

please help me to get the proper name in textbox
Posted

1 solution

Hi Sathish,

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

or

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

Hope this helps you a bit.

Regards,
RK
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900