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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:08:25+00:00 2026-05-18T03:08:25+00:00

I’m using the Razor view engine with MVC3 RC1 and Razor, and running through

  • 0

I’m using the Razor view engine with MVC3 RC1 and Razor, and running through the NerdDinner tutorial with it.

I have a partial view that contains some markup followed by this snippet of Javascript:

<script type="text/javascript">
    $(document).ready(function () {
        $("#Address").blur(function (evt) {
            $("#Latitude").val("");
            $("#Longitude").val("");

            var address = jQuery.trim($("#Address").val());
            if (address.length < 1)
                return;

            FindAddressOnMap(address);
        });
    }); 
</script>

I get a Parser error on the “if (address.length < 1)“: “Tag is missing a name. All tags must contain a valid tag name after the ‘<‘ character”.

I’ve tried using <text></text> around the block of code, but I still get the same error. Since there isn’t much official documentation available yet for Razor, I’m hoping someone will be able to tell me what I’m doing wrong and how to fix it.

  • 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-18T03:08:26+00:00Added an answer on May 18, 2026 at 3:08 am

    The problem looks to be that you probably have your script tag within a code block @{}.

    Checking the parser and attempting several different work arounds if you just remove the whitespace you’ll be fine. if (address.length<1)

    Strange though that it works in a custom app that uses the razor parser outside of MVC. This will probably take some work to find the real cause. Actually, some more detailed testing reveals that it does cause an error in the parser too – I just don’t do anything special which I want to say thanks for pointing this out. It’s something I’ll have to fix.

    The parser went through some changes between 2 and 3 so this is probably a bug introduced with those changes.

    • 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.