Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-03-29
3
Medium Priority
?
619 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 668 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 664 total points
ID: 37784371
Also, use &copy; for the copyright symbol.
0
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 668 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 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