Last post May 10, 2011 01:44 AM by jan.nemec
May 09, 2011 06:24 AM|jan.nemec|LINK
I am retrieving the string data from a database SQL Server 2008 EE to a web page created by ASP.NET MVC (language C#). In that text are symbols like í,ú,á... The text is displayed in the web browser correctly but when I look at the source code of that page
instead of chars like í ú á is there í ú á.
How can I have in the source code symbols like í, ú, á instead of í ú á?
Thanks for helping.
May 09, 2011 06:45 AM|rajesh.rram|LINK
Hi, You can use the Server.HtmlEncode (or) Server.HtmlDecode methods to encode (or) decode the html respectively.
May 09, 2011 07:45 AM|jan.nemec|LINK
thanks for answer but it's not solution of my problem. The output from the database on my web page is rendered OK (I can see á, í...) but when I look at the source code of this page in IE9 or Mozilla Firefox 4, instead of á, í.. I see this: í ú
and I would like to have the symbols like á, í also in the source code due the SEO optimization.
May 09, 2011 07:54 AM|tanatrajan|LINK
use @Html.Raw(....) in view to render properly
May 09, 2011 09:22 AM|jan.nemec|LINK
In the source code there is still problem with symbols like í instead of symbol í...
Is there any possibility to use Raw method for that or any other solution?
Thanks for help.
May 10, 2011 01:44 AM|jan.nemec|LINK
Can anybody help me with my problem when I use HtmlHelper DropDownListFor method and I don't want to encode the output in the
source code? In the rendered page is everything OK but the problem is in the source code of this page - more in my previous comment.
UPDATE: I my another forum user "nobdy" wrote:
I dont thing this is a problem at all. we do encode these symbols for best pracatice and thats what W3C rules say. Browser renders these codes to symbols and display it.
White Space :
> : >
< : <
So dont worry, this will not hurt your seo.