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 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.
<div>Thanks for answer that helps me!</div> <div></div> <div>But I don't know how to use that helper method (@Html.Raw) when I use another helper method to generate html output. </div> <div>For example I use this:</div> <div>
<div> </div> <div>@Html.DropDownList(</div> <div></div> <div></div>
<div>"CategoryId",
(SelectList)(ViewData["CategoriesList"]),"Select
Category")</div> </div> <div> </div>
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?
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:
Hi,
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.
Member
6 Points
11 Posts
Invalid chars in the source code of the web page
May 09, 2011 06:24 AM|jan.nemec|LINK
Hello,
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.
Member
60 Points
23 Posts
Re: Invalid chars in the source code of the web page
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.
Member
6 Points
11 Posts
Re: Invalid chars in the source code of the web page
May 09, 2011 07:45 AM|jan.nemec|LINK
Hi,
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.
Participant
1050 Points
369 Posts
Re: Invalid chars in the source code of the web page
May 09, 2011 07:54 AM|tanatrajan|LINK
use @Html.Raw(....) in view to render properly
Adimulam Natarajan
MCSA – Office 365
Member
6 Points
11 Posts
Re: Invalid chars in the source code of the web page
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.
Member
6 Points
11 Posts
Re: Invalid chars in the source code of the web page
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:
Hi,
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.
e.g.
White Space :
> : >
< : <
So dont worry, this will not hurt your seo.