Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 360
  • Last Modified:

Problem with MVC3 Razor syntax

Why does this call work, yet the second one fails?

@Html.ContentDropDownListFor(m => m.SecurityQuestion)


@{ Html.ContentDropDownListFor(m => m.SecurityQuestion); }

What am I missing??
0
newbieweb
Asked:
newbieweb
1 Solution
 
IrzanaCommented:
@ is to identify the start of the code, if you say @{ then it has no meaning.
curly bracket is to contain a code block, so it has to appear after a valid code

example @if() {}
0
 
newbiewebSr. Software EngineerAuthor Commented:
Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now