[Coding] Re-Entry to .NET

Posted by Khatharsis on April 4, 2013

I mentioned previously that PHP has always felt like home to me. My webhost is PHP-based, a lot of my side projects involve PHP, and I have a Ubuntu virtual machine that I use for sandbox development before deploying it on my webhost server. My first job used classic ASP and .NET. I learned a lot. Microsoft products always have its quirks and the little habits I used to have (like muscle-memory shortcut keys) have been long forgotten in the few years I’ve been away. The plus is it’s not entirely new and old bad habits, if I can identify them early enough, are easier to fix. That said, I have a growing list of small habits to reform and wanted to document them here. I also wish to keep a documentation of the topics I am re-covering and quirks I have questions about, but need more time to explore later.

Last Updated: 4/11/13

Shortcut keys:

  • Ctrl-Shift-B: build solution
  • Ctrl-F5: start without debugging
  • F7: toggle between code behind and designer view (I’d much rather toggle between source view, but I can’t find this option)
  • Shift-F7: toggle between designer view and code view

note: I will, at times, use VIM commands like ‘:w’ when I want to save. I will have to look into VIM extensions/plugins to keep practicing my VIM-fu.

Customization:

  • Word wrap: Tools -> Options -> General/All Languages -> Word Wrap (does not allow to specify number of chars unfortunately)
  • Keyboard shortcuts: Tools -> Customize… -> Keyboard… (button at bottom)

Topics covered:
From tutorials.com (note: slightly outdated; does not work with master pages, some fiddling required):

  • Hello, World
  • Events
  • UserControls
  • Validation
  • Caching
  • Cookies/State/Sessions
  • Localization

MVC Movie tutorial; using VS2010 instead of 2012 caused problems with the last half involving databases. This solution works to get further along, but Code First Migration used in the last few sections made it impossible to follow along.

Quirks:

  • Why ‘runat=”server”‘ property in every tag?
  • Why is there only support for one server-side form on a page?
  • Multiple validators will sometimes POST the page, despite the value it is supposed to validate not being valid. The error message is displayed briefly before the page is reloaded.