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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:49:18+00:00 2026-06-06T00:49:18+00:00

I am new to ASP MVC and as part of learning i was developing

  • 0

I am new to ASP MVC and as part of learning i was developing a small map appliation.

below is the code snippet

<ul>  
  <script type="text/javascript">
    @foreach (var item in Model){
            @:AddLocationPin(@item.geo_lat, @item.geo_long, null, 'place 1'); 
           }
</script>
    </ul>

I expect the server to send to browse the something like following

<script type="text/javascript">
AddLocationPin(1.5,-2.9, null, 'place 1'); 
AddLocationPin(11.5,-12.9, null, 'place 1');
 </script>

insted when I use Firebug on Firebfox I see the server sending the following

<script type="text/javascript">
</script>

could anyone of your help me as to what I am doing wrong ?
excuse me if this is a very basic question.

  • 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-06T00:49:19+00:00Added an answer on June 6, 2026 at 12:49 am

    Once inside Razor block you don’t need to put @ at every line.

    <script type="text/javascript">
        @foreach (var item in Model){
                AddLocationPin(@item.geo_lat, @item.geo_long, null, 'place 1');
               }
      </script>
    

    Razor cheatsheet: http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx

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

Sidebar

Related Questions

Good Morning All, I am developing a new ASP.net MVC web application. Part of
I am new to ASP.NET MVC framework, I would like to achieve the below
I have this part in asp.net MVC 3 view: <tr> <td>@Html.LabelFor(x => x.DateOfBirth, new
Brad Wilson posted a great blog series on ASP.NET MVC's new ModelMetaData: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html In
Im new to asp.mvc. I'm trying to develop a portal to maintain employee data.
I have a new asp.net mvc project and i am trying to figure out
Being rather new to ASP.MVC I'm looking for a solution to the following routing
I created a new ASP.NET MVC application. The home page looks like this: I
I'm fairly new to ASP MVC so go easy :). I have a form
From a brand-new ASP.NET MVC 4 Beta Web Application, I'm re-arranging my folders to

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.