Solved

How to Get Improper Characters to stop Displaying in ASP .NET/HTML Cod

Posted on 2012-03-29
3
607 Views
Last Modified: 2012-09-12
I am new to web development, and i am receiving an issue with a piece of code that is written in ASP .NET/HTML. (The code that generates the portion of the page that is causing invalid characters to be displayed is shown below. The portion of the page that is rendering the invalid characters can be seen in the attached image.) Could someone explain what is causing the invalid characters to appear in in front of the copy right sign and after the Rights sign? Any help would be greatly appreciated.

    <div id="footerNavSeals">

        <script type="text/javascript" src="https://seal.verisign.com/getseal?host_name=www.somecompany.com&amp;size=S&amp;use_flash=NO&amp;use_transparent=NO&amp;lang=en"> </script>

        <a style="padding-right: 20px"></a>
        <br />
        <a href="http://www.verisign.com/ssl/ssl-information-center/" target="_blank" style="padding-right: 20px;
            padding-left: 5px; padding-bottom: 5px; margin: 0px; font: bold 7px verdana,sans-serif;
            color: #000000; padding-top: 5px; text-align: center; text-decoration: none">ABOUT
            SSL CERTIFICATES </a>
    </div>
    <div class="clr">
    </div>
    <div id="footerNavBr1">
        <!--<img src="/a/global/shim.gif" width="1" height="13" alt="" border="0" />-->
    </div>
    <div id="footerNavCopy">
        <p class="contentFNavCopy">
omitted
</p>
        <p class="contentFNavCwrite">
            &#169; 2011<sup>&reg;</sup></p>
    </div>
    <div id="footerNavBtm">
        <!--<img src="/a/global/shim.gif" width="1" height="15" alt="" border="0" />-->
    </div>
</div>

Open in new window


New display issue
0
Comment
Question by:thenthorn1010
3 Comments
 
LVL 15

Assisted Solution

by:pateljitu
pateljitu earned 167 total points
ID: 37784127
If your website is build using DOTNET, you could add <globalization> to web.config file as below:

<globalization
            requestEncoding="utf-8"
            responseEncoding="utf-8"  />

OR

maybe even add <%@CodePage=65001 %> on your ASPX page directives (but this would be required on all pages)

If using CLASSIC ASP please use code as provided:

<%@ Language="VBSCRIPT" CODEPAGE="65001"%>
<%      
    Option Explicit
    Response.CharSet = "UTF-8"
%>
0
 
LVL 13

Assisted Solution

by:Rick
Rick earned 166 total points
ID: 37784371
Also, use &copy; for the copyright symbol.
0
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 167 total points
ID: 37786491
In agreement to both above experts comments, I woudl like to add some points:

1. Could you make ensure that you have set doctype for the .aspx page properly like as: (2nd line after Page directive mostly)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Open in new window


2. Is your browser character encoding set to default to Western (ISO-8859-1) (Mozilla Firefox). You can set it by Tools -- Options -- Content -- Advanced tab for fonts --  Default Character Encoding.

or try to set it to Unicode (UTF-8) either. Because those things override the page settings, if you have allowed browser settings to override.

3. The code you shared is having last <div> element extra. Sometimes improper closing of tags also causes problems. So make sure that there is no improper ending of any elements.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question