Solved

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

Posted on 2012-03-29
3
593 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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 learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now