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

  • Home
  • SEARCH
  • 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 6142753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:25:56+00:00 2026-05-23T18:25:56+00:00

I am getting the error on the below code in asp.net 4.0 <script type=text/javascript

  • 0

I am getting the error on the below code in asp.net 4.0

<script type="text/javascript" src='<%#=ResolveUrl("~/Scripts/jquery-1.4.1.js")%>'></script>

Error Message: CS1525: Invalid expression term ‘=’

I am using this code in Site.Master in head tag

  • 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-23T18:25:56+00:00Added an answer on May 23, 2026 at 6:25 pm

    You can’t use <%# and <%= at the same time. Try it like this:

    <script type="text/javascript" src='<%= ResolveUrl("~/Scripts/jquery-1.4.1.js")%>'></script>
    

    EDIT
    If you are getting an error that states:

    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
    

    when you try to use <%= ResolveUrl(..., it is because something in your code is attempting to add controls to your header control in Site.Master. If that is the case, switch the script tag to read:

    <script type="text/javascript" src='<%# ResolveUrl("~/Scripts/jquery-1.4.1.js")%>'></script>
    

    and make sure you call the DataBind() method on the header tag at some point (for example, from the Page_Load method for Site.Master):

    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Header.DataBind();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error message with the code below: class Money { public: Money(float
I am getting JQUERY undefined error. Do you have any idea (code below). <%@
I am getting an EVENT undefined rror in the ASP.NET C# code below. I
I'm getting the below error in my C#/ASP.NET project for some reason - presumably
I'm getting error below when I debug my ASP.NET MVC app. Any thoughts on
I have the below error message in my asp.net website when i replaced the
I'm getting the following error on the line of code below: Syntax error (missing
I’m getting system error when I try to compile the code below on Visual
I am getting an compilation error not a statement for the below code. Not
I am getting LNK2001 error. The code has been included below. Can someone please

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.