So I totally buy into the basic tenents of ASP.NET, testability, SoC, HTML control...it\'s awesome. However being new to it I have a huge hang up with the markup. I know it co
I would look at some of the other View engines available, I personally really like Spark view engine but there are many others out there.
Scott Hanselman did a great post looking at spark and Nhaml with some snippets of markup that you can look at to see if it fits your asthetics :)
http://www.hanselman.com/blog/TheWeeklySourceCode30SparkAndNHamlCrazyASPNETMVCViewEngines.aspx
If you press ctrl+z after it formats it just undoes the formatting and not the typing.
I find this helpful to keep the first bracket on the same line as the if statement
Move some (not all, only in cases it makes sense) display logic (like your dates) into your model. For instance, in your example you could add a Task.DisplayDate string property that handles the .ToShortDateString() call. Then if it ever changes, you change it all in one place and it shortens up the code in the view.
HTML helpers are nice, sometimes. I don't really like having my HTML in concatenated strings or a StringBuilder in a class somewhere, but if you're doing something a lot that works with a lot of different sets of data they're not so bad.
I would also change your C# code formatting preferences to have brackets on the same line. That cuts down the clutter. Unfortunately you can't have separate settings for this between the code editor and the HTML editor, so you'll have to get used to it in your code too. It's not the worst thing in the world.
What others have said helps too: use partial views and strong-typing.
Well now you could try out Razor (in ASP.NET MVC 3)
I just hope that the "@" won't scare you too :P
I'd suggest looking at the Velocity templating engine that MonoRails used. ASP.NET MVC models itself very closely on the MonoRails format, so using the Velocity templates is fairly easy.
Click here to learn more.
1) Helpers reduce HTML noise
2) Partial Views to break up larger pages/reuse view code
3) Try a different rendering engine, such as Sparkline
4) REFACTOR if your view includes too many if
statements.