find a location for property in a new city

Saturday, 27 October 2012

Unexpected "string" keyword after "@" character. Once inside code, you do not need to prefix constructs like "string" with "@"

After upgrading an ASP.NET MVC 3 project to MVC 4 I noticed a change in the Razor parser that threw a Parser Error saying: 'Unexpected "string" keyword after "@" character. Once inside code, you do not need to prefix constructs like "string" with "@"'

Firstly this has always working when it was MVC 3 and Razor v1. I may have been getting the syntax wrong all along but if the syntax allowed it was it really wrong?

What I was doing was trying to put some server code in a Razor helper with no surrounding HTML tags, like this example:

@helper Currency1000s(int? value)
{
    if(value == null)
    {
        -
    }
    else
    {
        @string.Format("{0:C0}k", value / 1000.0)
    }
}

Interestingly if I were to replace line 9 with @value all would be fine. Anyway, it is an easy enough fix, you just need to wrap the string.Format in HTML tags or the text tags as I did here:

@helper Currency1000s(int? value)
{
    if(value == null)
    {
        -
    }
    else
    {
        @string.Format("{0:C0}k", value / 1000.0)
    }
}

Follow britishdev on Twitter

107 comments:

  1. Keyword point of view your post gives us some great information, I really like it because first time in my life i am reading this type of information. New Playground tiles Uk for sale visit http://playgroundtilesuk.co.uk/

    ReplyDelete
  2. First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks. Now i need to my blog, you can play, relax and fun with games at here
    friv games 4
    jogos 6
    friv 5 games
    friv 10

    ReplyDelete
  3. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.Marble India

    ReplyDelete
  4. Good post. I learn some thing tougher on distinct blogs everyday. Most commonly it really is stimulating to learn to read content material from other writers and exercise a specific thing there.Luxury Escapes

    ReplyDelete
  5. Not all are true. Everyone has their own way of thinking but I think they have to reconsider. I like to argue for the most accurate results.
    http://fivenightsatfreddysplay.com

    ReplyDelete
  6. That's amazing dude! Now the local best double glazing companies are doing really well by providing highest quality products and adding latest features for more convenience. Don't they?

    ReplyDelete
  7. By reading this article I get a lot of lessons and this is very useful . cara menggugurkan kandungan

    ReplyDelete
  8. These things are very important, good think so - I think so too.. a5 booklet design

    ReplyDelete
  9. Hi there, I discovered your blog per Google bit searching for such kinda educational advise moreover your inform beholds very remarkable for me.. Hotmail Login

    ReplyDelete
  10. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing.. locksmiths in birmingham

    ReplyDelete
  11. I enjoyed over read your blog post. Your blog has nice information, I got good ideas from this amazing blog. I am always searching like this type blog post. I hope I will see again 3313 exam questions

    ReplyDelete
  12. Packers and Movers Pune Provide High Quality ***Household Shifting, Home/Office Relocation, Insurance, Packing, Loading, ###Car Transportation Service Pune and High experiences, Top Rated, Safe and Reliable, Best and Secure Packers and Movers Pune Team List. Get ✔✔✔ Affordable Rate Charts and Compare Quotation and Save Money and Time .
    Packers And Movers Pune

    ReplyDelete
  13. Hire Best Packers And Movers Mumbai for hassle-free Household Shifting, ***Office Relocation, ###Car Transporation, Loading Unloading, packing Unpacking at affordable ✔✔✔ Price Quotation. Top Rated, Safe and Secure Service Providers who can help you with 24x7 and make sure a Untroubled Relocation Services at Cheapest/Lowest Rate
    Packers And Movers Mumbai

    ReplyDelete
  14. Get Packers and Movers Jaipur List of Top Reliable, 100% Affordable, Verified and Secured Service Provider. Get Free ###Packers and Movers Jaipur Price Quotation instantly and Save Cost and Time. Packers and Movers Jaipur ✔✔✔Reviews and Compare Charges for household Shifting, Home/Office Relocation, ***Car Transportation, Pet Relocation, Bike SHifting @
    Packers And Movers Jaipur

    ReplyDelete
  15. Packers and Movers in Delhi -Air wares Packers and Movers could be a metropolis primarily based Packers Movers Company providing reliable and cost-efficient Packers Movers services, Packers and Movers in metropolis and Packing Moving services all told over Republic of India. it's branches all told the most cities of Republic of India. Packers and Movers in metropolis worth the emotions of our customers and thence take that any care, whereas moving and packaging the merchandise of our customers.

    ReplyDelete
  16. Packers and Movers in Delhi - Air payload Packers and Movers may be a Ncr primarily based Packers Movers Company providing reliable and efficient Packers Movers services, Packers and Movers in Ncr and Packing Moving services all told over Asian nation. it's branches all told the most cities of Asian nation..

    ReplyDelete
  17. Motifz Designer Lawn. 1, 2 & 3 Piece Unstitched Premium Embroidered Lawn 2019, Premium Lawn, Lawn 2019, Best lawn collection, Motifz, Best Lawn in Pakistan, Shipping worldwide. Stitching option available.

    ReplyDelete
  18. Buy Premium lawn Online for Women's at best prices available at Motifz. ✓ Latest Fashion, ✓ Trendy Designs ➤ Shop Now!

    ReplyDelete
  19. We Provide Best Packers And Movers Ghaziabad List for Get Free Best Quotes, Compare Charges, Save Money And Time, Household Shifting Services .
    Packers And Movers Ghazibad

    ReplyDelete
  20. Packers and Movers Ahmedabad - We Provide ***Best Service Providers, Safe, Reliable, Affordable, Trusted ###Movers and Packers in Ahmedabad List, Household Shifting, Office Relocation: Choose Top Verified Packers and Movers Ahmedabad Compare ???Shifting Service Chrages, Price Quotation, Rate List Charts and Save Money and Time @ Packers and Movers Ahmedabad

    ReplyDelete
  21. Get Packers and Movers Kolkata List of Top Reliable, 100% Affordable, Verified and Secured Service Provider. Get Free ###Packers and Movers Kolkata Price Quotation instantly and Save Cost and Time. ???Packers and Movers Kolkata Reviews and Compare Charges for household Shifting, Home/Office Relocation, ***Car Transportation, Pet Relocation, Bike SHifting @ Packers and Movers Kolkata

    ReplyDelete
  22. Superb post, we enjoyed each and everything as per written in your post. Thank you for this informative article because it’s really helpful, I really like site.
    Please visit our website: @ Packers and Movers Ahmedabad

    ReplyDelete
  23. janusgames Thanks for sharing such a very good blog and very informative. I found so many interesting stuff in your blog especially its discussion. I like this very much

    ReplyDelete
  24. Get Shifting/Relocation Quotation from ###Packers and Movers Delhi. Packers and Movers Delhi 100% Affordable and Reliable ***Household Shifting Services. Compare Transportation Charges and Save Time, Verified and Trusted Packers and Movers in Delhi, Cheap and Safe Local, Domestic House Shifting @
    Packers And Movers Delhi

    ReplyDelete
  25. This is really unbelievable and extraordinary work. Everyone should read. Thanks for sharing and don't miss WORLD'S BEST

    MotorCycleGame

    ReplyDelete
  26. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. Oh My Home UK

    ReplyDelete
  27. I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious... Property Management Sarasota Florida

    ReplyDelete
  28. I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. Agen Casino

    ReplyDelete
  29. I like your post. It is good to see you verbalize from the heart and clarity on this important subject can be easily observed... Agen Casino

    ReplyDelete
  30. Packers And Movers Bangalore Local Household Shifting Service, Get Free Best Price Quotes Local Packers and Movers in Bangalore List, Compare Charges, Save Money
    And Time @ Packers And Movers Bangalore

    ReplyDelete
  31. Packers and Movers Chennai Give Safe and Reliable ***Household Shifting Services in Chennai with Reasonable ###Packers and Movers Price Quotation. We Provide Household Shifting, Office Relocation, ✔ ✔ ✔ Local and Domestic Transportation Services, Affordable and Reliable Shifting Service Charges @ Packers And Movers Chennai

    ReplyDelete
  32. Packers and Movers Gurgaon Provide Reliable, Safe and Certified Service Provider list, Get Free ***Best Price Quotaition and Compare Charges. ???Hassle free Household Shifting Services, High Quality packing Material, Office Relocation, Car Transportaion, ###Local and Domestic Shifting Service @
    Packers And Movers Gurgaon

    ReplyDelete
  33. Enjoyed every bit of your blog article.Really looking forward to read more. Really Cool. @ Packers And Movers Delhi
    Packers And Movers Noida

    ReplyDelete
  34. Wholesale printed custom perfume boxes with the highest quality and affordable prices. Free worldwide Delivery and free Custom Perfume Boxes design.

    ReplyDelete
  35. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!.@ Packers and Movers Ahmedabad

    ReplyDelete
  36. Buy online wholesale printed custom candle boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!

    ReplyDelete
  37. Buy online wholesale printed lipstick boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!

    ReplyDelete
  38. Your site is truly cool and this is an extraordinary moving article. @ Packers And Movers Chennai

    ReplyDelete
  39. Buy online wholesale lipstick boxes and packaging at seashore packaging at the easy price Free shipping worldwide with 24/7 customer support.

    ReplyDelete
  40. Blackbird packaging provide you with any size, shape design, CBD boxes sooner than any other packaging competitor in the market

    ReplyDelete
  41. Packaging town is a one-stop solution for the short-run Custom Packaging, Wholesale CBD Boxes needs, and supplies at ease.

    ReplyDelete
  42. direct print mylar bags in stock now. Ready made Cali pack designs. Fast Shipping at Your Supplies. Custom designs available

    ReplyDelete
  43. mylar label bags in stock now. Ready made Cali pack designs. Fast Shipping at Your Supplies. Custom designs available

    ReplyDelete
  44. Blackbird packaging provide you with any size, shape design, cbd tincture boxes sooner than any other packaging competitor in the market

    ReplyDelete
  45. Great Article
    Cloud Computing Projects




    Networking Projects



    Final Year

    Projects for CSE





    JavaScript Training in Chennai



    JavaScript

    Training in Chennai




    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals,

    Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer.

    Angular Training

    ReplyDelete
  46. Blackbird packaging provide you with any size, shape design, custom pet food packaging sooner than any other packaging competitor in the market

    ReplyDelete
  47. Packaging town is a one stop solution for the short-run cbd tincture boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  48. direct print mylar bags 3.5g direct print mylar bag, available at Your Supplies. This bag comes with cookies holograms. Heat sealable. Fast Shipping.

    ReplyDelete
  49. gelati bags 3.5g Direct Print on the front and back. % Cali Packs Available at Your Supplies. Heat sealable mylar bags. Fast Shipping.

    ReplyDelete
  50. Blackbird packaging provide you with any size, shape design, cbd lotion boxes sooner than any other packaging competitor in the market

    ReplyDelete
  51. Packaging town is a one-stop solution for the short-run custom apparel boxes needs, and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  52. custom direct printed mylar bags UK in stock now. Ready made Cali pack designs. Fast Shipping at Your Supplies. Custom designs available

    ReplyDelete
  53. custom printed mylar bags UK in stock now. Ready made Cali pack designs. Fast Shipping at Your Supplies. Custom designs available

    ReplyDelete
  54. Packers and Movers Bangalore - Reliable and Verified Household Shifting Service Providers Give Reasonable ###Packers and Movers Charges. Cheap and Best Office Relocation Compare Quotation for Assurance for Local and Domestic House Shifting and Get estimates today to save upto 20%, ***Read Customer Reviews - @ Packers And Movers Bangalore

    ReplyDelete
  55. Packaging town is a one stop solution for the short-run custom soap boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  56. buy men sweatshirts online from wild goat clothing

    ReplyDelete
  57. vaccum cleaners
    Shop for Electronic Goods at Al-Fatah, Pakistan's leading chain of departmental stores. Shop from a huge range of top brands Home Appliances, Smart-tech and Phones and Sound bars from Al-Fatah. Shop from huge range of electronics available at Al-Fatah. Avail Free Delivery on orders above 1000 PKR in selected cities.

    ReplyDelete
  58. buy lahore grocery from alfatah at best prices. get free shipping

    ReplyDelete
  59. buy online zipper hoodie online from wild goat clothing at best prices. Get Free shipping

    ReplyDelete
  60. buy wholesale cbd bath bombs from blackbird packaging at best prices. Get free shipping.

    ReplyDelete
  61. You can book call girl in Guwahati or escort Service in Guwahati for incall facility or
    outcall Facility as and when required.To book Guwahati call girls you
    can visit the following links
    Escort Service in Guwahati
    Call Girl Service in Guwahati

    ReplyDelete
  62. Make your daily life passionately amazing with Guwahati escort and call girl services.
    Romance is not a simple factor that you can bargain with.
    Guwahati Call Girls
    Call Girls in Guwahati

    ReplyDelete
  63. Guwahati Escorts or call girls in Guwahati are those call girl who are rocking and
    amazing in terms of better-quality sexual performance for the customer.
    Guwahati escort
    Guwahati escort service

    ReplyDelete
  64. Explore the profiles of guwahati escorts, guwahati call girls, call girls in guwahati and
    escorts in guwahati for female companionship in top rated hotels.
    Get affordable escort services in guwahati hotels now.
    Guwahati escort
    Call girl in Guwahati

    ReplyDelete
  65. Very nicely written blog...Relly loved reading it...Please check my blogs for
    Bhubaneswar call girl
    Bhubaneswar escort service

    ReplyDelete
  66. Shop from a vast range of variety of imported and local stock of prams and strollers online from Al-Fatah. Get your hands on the new wide range of prams, strollers, baby toddler strollers and baby prams from all the top brands. Avail Free Delivery on orders above 1000 PKR for selected cities in Pakistan.

    ReplyDelete
  67. Blackbird packaging provide you with any size, shape design, cookie boxes wholesale sooner than any other packaging competitor in the market

    ReplyDelete
  68. This is really interesting post, You're a very skilled blogger. Also, I've shared your site in my social networks! Packers And Movers Chennai

    ReplyDelete
  69. Blackbird packaging company can provide you with any size, shape design, and custom bottle neckers wholesale sooner than any other packaging competitor in the market

    ReplyDelete
  70. Buy pret collection 2021 online from Ilaha Clothing at best prices. Get free shipping.

    ReplyDelete
  71. Blackbird packaging provide you with any size, shape design, cookie boxes wholesale sooner than any other packaging competitor in the market

    ReplyDelete
  72. Packaging town is a one stop solution for the short-run custom apparel packaging needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  73. buy wholesale cookie boxes online from Blackbird Packaging at best prices. Get free shipping

    ReplyDelete
  74. Blackbird packaging company can provide you with any size, shape design, and bath bomb boxes sooner than any other packaging competitor in the market

    ReplyDelete
  75. Blackbird packaging company can provide you with any size, shape design, and bath bomb packaging sooner than any other packaging competitor in the market

    ReplyDelete
  76. Packaging town is a one stop solution for the short-run candle boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  77. Thanks for sharing information with us…satisfied after visiting your blog…. Learn the latest trends & their practical application by experts with us…you can contact us click on
    Visit ISMT India

    ReplyDelete
  78. buy gym leggings online from dshred at easy prices at your doorstep. get free shipping.

    ReplyDelete
  79. buy gym tights online from dshred at best prices. Get free delivery

    ReplyDelete
  80. Thanks for sharing information with us…satisfied after visiting your blog… Prepare for CAT, CMAT, MHCET, GRE, GMAT, SAT, CLAT, MHCET Law, BBA IPM with our live online courses. To visit us, click on link
    Visit Career Managers

    ReplyDelete
  81. buy gym leggings for women online from Dshred at easy prices delivered at your doorstep. Get free shipping

    ReplyDelete
  82. buy dental care products online at best prices from medisense delivered at your doorstep. Get free delivery

    ReplyDelete
  83. buy mother care pk from Medisense.pk delivered at your doorstep at best prices. Get free shipping

    ReplyDelete
  84. buy men tank tops online from Dshred at best prices delivered at your doorstep. Get free shipping

    ReplyDelete
  85. buy gym tights for women online from dshred at easy prices delivered at your doorstep.get free shipping.

    ReplyDelete
  86. buy cosmetics in Pakistan from alfatah at best prices delivered at your doorstep. get free delivery

    ReplyDelete
  87. buy baby care products online online from medisense at best prices deloivered at your doorstep. get free shipping

    ReplyDelete
  88. Buy citizen ch 453 bp monitor price in pakistan at easy prices from medisense delivered at your doorstep. Get free shipping.

    ReplyDelete
  89. Buy otc drugs online at easy prices from medisense delivered at your doorstep. Get free shipping.

    ReplyDelete
  90. Buy baby food online at easy prices from medisense delivered at your doorstep. Get free shipping.

    ReplyDelete
  91. Buy hair care supplements at easy prices from medisense delivered at your doorstep. Get free shipping.

    ReplyDelete
  92. buy inner wear for girls online from dshred at easy prices delivered at your doorstep. get free shipping

    ReplyDelete
  93. buy lounge wear online from Dshred at best prices delivered at your doorstep. get free shipping

    ReplyDelete
  94. Sometimes you just want to relax at home, but how can one relax if they do not feel comfortable? That is why Dshred is offering the most comfortable Women Loungewear products available. Get our knitted loungewear sets for maximum comfort or our Women’s loungewear tracksuits if you plan to go out for a bit.

    ReplyDelete
  95. Study Engineering at the best autonomous college in AP with scholarships and full faculty support with high quality education and professional career support.
    https://www.adityatekkali.edu.in/

    ReplyDelete