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 4234216
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:19:22+00:00 2026-05-21T02:19:22+00:00

I am using JQuery Syntax highlighter in my asp.net application. http://www.steamdev.com/snippet/ I have included

  • 0

I am using JQuery Syntax highlighter in my asp.net application.

http://www.steamdev.com/snippet/

I have included the scripts and CSS file as mentioned in the USAGE section.

Also the below code:

<script>
 $(document).ready(function(){  $("pre.htmlCode").snippet("html"); 
     // Finds <pre> elements with the class "htmlCode"     
     // and snippet highlights the HTML code within.
       $("pre.styles").snippet("css",{style:"greenlcd"}); 
           // Finds <pre> elements with the class "styles" 
               // and snippet highlights the CSS code within
                    // using the "greenlcd" styling.  
      $("pre.js").snippet("javascript",{style:"random",transparent:true,showNum:false});     
      // Finds <pre> elements with the class "js"     
      // and snippet highlights the JAVASCRIPT code within     
      // using a random style from the selection of 39     
      // with a transparent background     
      // without showing line numbers.
   });

</script>
<script>
$(document).ready(function(){
      $("pre#dynamic").snippet("php",{style:"navy",clipboard:"js/ZeroClipboard.swf",showNum:false});
               // Highlights a snippet of PHP code with the "navy" style         
               // Hides line numbers      
               $("pre#dynamic").click(function(){
                        $(this).snippet({style:"vampire",transparent:true,showNum:true});       
                          // Changes existing snippet's style to "vampire"         
                          // Changes the background to transparent         
                          // Shows line numbers  
   }); 



    }); 



</script>

Result: I am getting the code section like below

Code highlighting

But the code is going out from the highlighter, also I have no option of copy clicpboard.

How to include that into my page?

While inserting the data I have used <pre></pre> tag only. Do I need to specify the language in pre? Because I am also not getting the color code

EDIT

I am calling the JS and CSS file like the below

 <link href="jquery.snippet.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="<%=ResolveUrl("~/JS/jquery.snippet.js")%>" ></script>

EDIT1

It is in collapse mode and when I clicked on “text” link I can see all formating are gone. Any suggestion how can I keep the HTML mode in expand format?

enter image description here

  • 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-21T02:19:22+00:00Added an answer on May 21, 2026 at 2:19 am

    I think you might have to specify the language in the class of the pre element, eg:

    <pre class="htmlCode">
       //...code snippet here
    </pre>
    

    The code you posted looks for the following:

    <pre class="htmlCode">...</pre> <!-- html -->
    <pre class="styles">...</pre>  <!-- css -->
    <pre class="js">...</pre>  <!-- javascript -->
    <pre id="dynamic">...</pre>  <!-- php -->
    

    EDIT

    To add c#, you’d probably have to do:

    <pre class="csharp">
        public static void Main(string[] args)
        {
             Console.WriteLine("Hello World");
             Console.ReadLine();
        }
    </pre>
    <script>
         $("pre.csharp").snippet("csharp");
    </script>
    

    NOTE it’s easier to use csharp rather than c# as the language name, as # has a special meaning on the web.

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

Sidebar

Related Questions

No related questions found

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.