Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Friday, April 15, 2011

ASP.NET MVC 3 Sample Project Launched




Okay, after popular demand of I think 0 people, I’ve published my old demo MVC 1 project as an MVC 3 project. If you haven’t read any of the posts on the last demo project, check out this post. This project completely separates UI & C# code, so you only have 2 projects (Core & UI…not counting the Unit Tests project).

Basically, all I did was create a new MVC 3 project using Razor with Microsoft’s default template and deleted everything except the following:

  • Views folder
  • Root Default.aspx
  • global.asax (I did delete the global.asax.cs)
  • both web.configs

I referenced my Core, setup my views that match my Core project, and inherited from my global.cs in the global.asax. That was it!

You can download it via zip here: http://code.google.com/p/derans/downloads/list (the file is called DemoPhotographySite_v3.zip)

I feel like this project will act as a great stepping stone to understanding the Code Camp server, which is much more complex.

The sample project was built with the following tools:

If you downloaded the old one, you’ll notice that I removed the following 3rd parties:

The primary reason I removed these three parties is because MVC 3 and Razor are good enough so you don’t need the 3rd party tools.

The best practices I mentioned above come straight from experience and the following people/resources:

You can see the exact same Core code in use at sweetandhappy.com. If you see any improvements that can be made or you’d just like to comment, please do so!

Also, please note that I basically am even re-posting the exact same blog post I did over a year ago with my original MVC demo project. I hope you don’t mind, but it’s late and I have to work tomorrow :)

Thanks for reading!

Shout it

kick it on DotNetKicks.com

Thursday, February 04, 2010

General Tips & Tricks




I was in a meeting yesterday and one of my co-workers had an issue, while remoted into his desktop, with a window popping up on his secondary monitor. Luckily, I’ve used 2 – 4 monitors a long time and I’ve run into that same issue before. The solution?

1. Press Alt+Space
2. Press M
3. Push and hold the relevant arrow key until you see the window you want

So…after telling him how to solve that issue, I thought I’d post some other tips/tricks that I use quite a bit. Here’s another one:

Ever copy over your clipboard in Visual Studio and think, “Dang! Now I have to go copy that again”…or worse you cut it…then you get to Ctrl Z and then re-copy…HUGE pain. Well luckily for us, Visual Studio remembers your clipboard and you can take advantage of it by using Ctrl+Shift+V to cycle through your previous copies. This has saved me MANY times. NOT that you should copy and paste code...as a general rule...this is not a good thing :)

Ever have to minimize all your open windows to get to your desktop? My solution to this problem was to create a group of toolbars to categorize my apps. I leave the toolbar locked, never hidden, and always on top. When I first started using this method back in 2002, my boss at a startup called Icabob (now closed), hated it because I had the auto-hide enabled so everytime he’d try to go to the file menu, my toolbar would open. I was used to it so I didn’t have the same problem :)

Another nice thing about this is that I typically have all the same software installed on all my different machines, so I can copy and paste my root “toolbars” folder on all the machines and the shortcuts still work. Keep in mind, you only would add apps that you use quite a bit. So I don’t put my entire “All Programs” section in the toolbar. Anyhow, here’s my current toolbar setup, which is docked on the top of my screen:

image

Yes that is a GroupWise icon you see up there…so all you Outlook 2010 people (my pic is already on this page) complaining should remember there are worse things. However, we are going through an Exchange migration right now, so I’ll be joining in on the complaints soon enough I’m sure :)

Here are a couple shortcuts that I don’t see used often, but are handy:

Ctrl + Shift + Esc – Opens Task Manager

Win + Pause Break – Opens Computer Properties

Here’s a couple shortcuts specifically for VS IDE that I use a lot:

Ctrl + K + C – Comment Selected Code

Ctrl + K + U – Uncomment Selected Code

For more VS tips, check out Sara Ford’s book Visual Studio Tips 251 Ways to Improve Your Productivity

Anyhow, I thought I’d share some of the things I use daily that I’ve never seen used. I also want to post my favorite jQuery plugins, favorite Firefox add-ons, and VS plugins. I’m not sure if anyone is interested or not, but if you are, let me know!

Thanks for reading!

kick it on DotNetKicks.com

Sunday, December 27, 2009

ASP.NET MVC Solution Structure




After reading Jimmy Bogard’s post “Organizing ASP.NET MVC Solutions”, I decided to give it a try in my latest project. Basically it means ALL C# code is in the Core project and everything that represents a deployment are in the UI project. It makes deployment really simple. So far I like it because compile time is much faster and dealing with all the references is much simpler. Another thing to note is that if I wanted to extract anything out of my Core project, I’d just cut the folder I want to separate into another project. Here’s the structure of my current project after I got everything setup:

image

One difference between my setup and Jimmy’s is I don’t like having a Content folder. I’ve been doing the _c, _i, & _j since around 2003 and I like it for a few reasons. One, I always know that “global” items are at the top of my folder structure and I can quickly delete all other files in the structure. Two, it’s much shorter than content/images, content/css, content/etc. Three, I just like sticking with my standards I’ve created over the years. Definitely read Jimmy’s post for all his reasons and loads of comments.

Please let me know your thoughts! Thanks for reading!

kick it on DotNetKicks.com

Related Posts Plugin for WordPress, Blogger...