ASP.NET MVC 3 Razor Syntax question -


When I work with partial footage (MVC 3 / Razor), but I'm sure - this is a clear razor syntax question, this question appears then, not related to the related partial view - therefore I have partial with full markup The View menu is cshtml:
  @EmployableEnumerable & lt; SportsStore.WebUI.Models.NavLink & gt; @forcha (Miscellaneous Links in Model) {@ Html.RouteLink (link.Text, link.RouteValues); } No problem - see "Parents" @ {Html.RenderAction ("Menu", "Navigation");} And all the work is called magic. However, if I edit the menu.cshtml as:  
  @modelimimableable   

(See 'A' 'before HTML. Rutalink!) Has broken now: now @ {html. Render Action ("menu", "avi");} Output is completely empty, there is no HTML tag.

Want to know - what is the difference between the two pieces of code? Do I also accept "strong" @ @ before @ and also apply to Html.RouteLink ? So - am I wrong?

Before the statement @ it should be written in the output stream. When you delete it, what you are doing is calling a method call on the Html object.

@ - The purpose of the operator is two times. It can be used to output an expression in the section of the reaction as if you use it in the first example, start another code code block. @forac (Miscellaneous links in the model) With you can see this other behavior used in your code example.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -