You must Sign In to post a response.
  • Category: Policies & Guidelines

    How to use HTML tags in code snippets?

    All sections in this site except Forum are HTML enabled. This makes a potential problem for code snippet submissions.

    Many times, code snippets include the angle brackets (< and >). Since HTML is enabled, such angle brackets will be considered as HTML tags and will not appear when the code snippet is viewed.

    To make this work, if you use angle brackets in code snippets, they must be converted to corresponding escape charactes (< must be written as &LT; and > must be written as &GT;)

    For example, if you want to post the below code snippet:

    <input type=button id=btnSave>

    You must actually type:

    &LT;input type=button id=btnSave&GT;

    Also, there are few other things to consider when you post code snippets:

    1. The code portions within the resource must be embedded within the special tags [ CODE] and [/CODE ]

    If there are multiple sections of code mixed with descriptive content, each piece of code must be enclosed within the [ CODE] and [/CODE ] tags.

    2. If the lines of code within [ CODE] and [/CODE ] are too long, then split them in to multiple lines instead of having too long lines.

    (In case of Forum, HTML is disable by default, but we can enable it optionally for selected messages).
  • #558613
    Hi John

    Thanks for your Valuable message....

    This is what I'm struggling lot ,when i submitting Code snippet.

  • #558616

    Nice Hint to all the DNS memebrs

    Hope it will help to all.

    But some time we feel problem without HTML tags while writing


    Rajesh Kumar Parbat

  • #558624
    Thanks john
    Thanks for your Valuable message....



  • #558654
    Either We can manually type the angel brackets are we can use any HTML encoder to encode the codes which we are going to post.
    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #559306
    Good guidelines about code snippets as most of the members have issues in that.

    Thanks & Regards,
    Deepika - Sr. Editor
    Webmaster, GujaratSpider
    "Experience is the name everyone gives to his mistakes"

  • #565573
    I want to post a code what should I do?Please in simple word with example.

  • #566827
    I think if we can request the dotnetspider web developers to convert the tags implicitly. Then we don't have this problem.

    Since it would difficult for us to search for '<' and '>' symbols in every html code.

    Can't we solve in other which would allow everyone to freely paste the code.

    Vamsee Krishna

  • #572782
    This is really helpful


  • #572878
    Thanks Tony for the great instructions.

    Vamsee - There is no doubt your idea is great. But due some security issues we cant allow directly enter executable tags. Also, there is a lot of data in stored DB and its messy to implement the idea.

    Hope, you agree with me.


    Thanks & regards,
    Gaurav Kumar Arora
    Site Coordinator - DNS
    My blog -

  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.