A new breed of magic strings in ASP.NET MVC(lostechies.com)

submitted by johnsheehanjohnsheehan(4785) 3 years, 4 months ago

One of the common patterns in Ruby on Rails is the use of hashes in place of large parameter lists. Instead of hashes, which don’t exist in C#, ASP.NET MVC uses anonymous types for quite a few HTML generators on the view side. This is a trick used by the MVC team to simulate hashes. Since the dictionary initializer syntax is quite verbose, with lots of angly-bracket cruft, anonymous types provide a similar effect to hashes. However, don’t let the magic fool you. Anonymous types used to create dictionaries are still dictionaries.

2 comments |category: |Views: 373

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:
information Login or create an account to comment on this story