Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2012-03-29
3
Medium Priority
?
622 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Find out what you should include to make the best professional email signature for your organization.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

916 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