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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:33:12+00:00 2026-06-05T20:33:12+00:00

I am using Razor syntax in an ASP.NET MVC3 View inside a JavaScript code

  • 0

I am using Razor syntax in an ASP.NET MVC3 View inside a JavaScript code but I get a “conditional compilation is off” warning. I searched for it and found out that using /*@cc_on @*/ before the code turns it on. But I get an error “The name ‘cc_on’ does not exist in the current context”. Any ideas? Where exactly am I supposed to give /*@cc_on @*/ ?

Sample Code:

<script type ="text/javascript">
     @*
          - some multi-line comment stuff here
          - apparently the at signs cause syntax errors --argh!
     *@ 
</script>
  • 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-06-05T20:33:13+00:00Added an answer on June 5, 2026 at 8:33 pm

    Let me just guess… Try the following:

    /*@("@cc_on @")*/
    

    or

    @("/*@cc_on @*/")
    

    whatever you prefer

    I hope it’s correct Razor syntax. An idea is to render this value as a string as @ is used by razor (in your case compiler thinks that you want to output @cc_on variable which isn’t declared)

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

Sidebar

Related Questions

I'm using Asp.Net with Razor syntax and latest Telerik components. Unfortunately when I click
I have a page in Asp.Net MVC using the Razor syntax. In the page
I've got a large site that runs in ASP.NET MVC using the Razor view
I'm using ASP.NET MVC with Razor syntax. I'm trying to find the best way
I am working on an MVC3 application using the Razor syntax and I have
I am developing an ASP.Net MVC 3 Web application using Razor Views. I have
I'm currently working on my first MVC3 application at work (using the Razor view
I'm using MVC3 with razor view. I'm giving the user a list of <li>
I am building wizard step demo application with MVC3 and using razor view engine
I have online form builder appplication in ASP.NET MVC3 with Razor views. It is

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.