Solved

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

Posted on 2012-03-29
3
611 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

756 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