0

I am playing around with MVC and have started setting up an existing site we have built in standard .Net Forms.

I am only including a JS file and as all the requests are being routed via .Net it is trying to compile it.

It is the standard compilation error you would see with invalid c#:

CS1012: Too many characters in character literal

How do you prevent client assets being compiled?

Many thanks

1
  • I have resolved my problem. I had the script tag in my Master Page with a runat="server" in the declaration. This then made .NET try and compile the included JavaScript file?? I have done this quite happily in .NET 2.0 without problems. Commented Oct 25, 2008 at 11:45

2 Answers 2

1

I have resolved my problem. I had the script tag in my Master Page with a runat="server" in the declaration. This then made .NET try and compile the included JavaScript file?? I have done this quite happily in .NET 2.0 without problems.

Sign up to request clarification or add additional context in comments.

Comments

0

As far as I know that was the behavior of ASP.NET since ASP.NET 1.0. Any tag with runat="server" gets interpreted as server code and not a client script include.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.