Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6920491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:09:14+00:00 2026-05-27T10:09:14+00:00

Does anyone know how to disable auto parsing of chars such as > so

  • 0

Does anyone know how to disable auto parsing of chars such as “>” so that they never show up as “&qt;” when they are displayed in the browser? I thought that it was just related to xml parsing but it appears to be a global issue where VS uses “intelligent” parsing of strings and sometimes displays them as the actual char and sometimes converts them. Any suggestions?

Ex. 1:

C#:

public string kmlStuff = "";
    protected void Page_Load(object sender, EventArgs e) {
        kmlStuff="]]>";
    }

Aspx:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="errorM">
        <%=kmlStuff %>
    </div>
</asp:Content>

Html of browser output (is wrong):

<div id="errorM">
    ]]&gt;
</div>

What I want to show up:

<div id="errorM">
        ]]>
</div>

Ex. 2:

C#:

public string kmlStuff = "";
    protected void Page_Load(object sender, EventArgs e) {
        kmlStuff="<div></div>";
    }

Aspx:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="errorM">
        <%=kmlStuff %>
    </div>
</asp:Content>

Html of browser output (is right):

<div id="errorM">
<div></div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:09:15+00:00Added an answer on May 27, 2026 at 10:09 am

    Use this

    c#
    
    public string kmlStuff = "";
        protected void Page_Load(object sender, EventArgs e) {
            kmlStuff= Server.HtmlEncode("]]>");
        }
    
    
    ASpx
    
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <div id="errorM">
            <%=Server.HtmlDecode(kmlStuff) %>
        </div>
    </asp:Content>
    

    **Sample:

    using System;
    using System.IO;
    using System.Web;
    using System.Web.UI;
    public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        // This could mess up HTML.
        string text = "you & me > them"; // 1
        // Replace > with >
        string htmlEncoded = Server.HtmlEncode(text); // 2
        // Now has the > again.
        string original = Server.HtmlDecode(htmlEncoded); // 3
        // This is how you can access the Server in any class.
        string alsoEncoded = HttpContext.Current.Server.HtmlEncode(text); // 4
        StringWriter stringWriter = new StringWriter();
        using (HtmlTextWriter writer = new HtmlTextWriter(stringWriter))
        {
            // Write a DIV with encoded text.
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.WriteEncodedText(text);
            writer.RenderEndTag();
        }
        string html = stringWriter.ToString(); // 5
        }
    }
    

    **

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to disable the tool-tip boxes that popup when a Google
Does anyone know how to disable the swipe gesture in Xcode 4 that causes
does anyone know how to disable that slide animation and just have the action
Does anyone know how to enable or disable programmatically the Quick Edit Mode in
Does anyone know of any websites, or (preferably) downloadable packages that you can use
Does anyone know how to disable the product image zoom in Magento?
Does anyone know how to disable duplicate comment detection in Wordpress (2.9.2)? I'm looking
Does anyone know how to disable the reload grid button (a.k.a. the refresh button)
Does anyone know of a way to disable the mouse scroll wheel when a
Does anyone know if and how one can disable items in a databound ListBox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.