I recently had a conversation with someone who is looking to make a fresh start and become a developer (coming from other IT positions). The question they had was:
What should I learn to get started in .NET and web development?
Now this question was starting from a position of “I’d like to get started with .NET and the web. How do I do that?” So please hold your “No, choose Ruby (or NodeJS or … )” comments. That’s another blog post. :)
Here’s my advice along with a bunch of courses you can use to accomplish this efficiently and affordably. Continue reading →
[Note: reblogged from blog.learninglineapp.com. I'd like to personally invite you to check out our work over at LearningLine - just follow the links below.]
We believe that LearningLine is the most effective online training for developers, period. Today it gets even better. We are announcing the ability to preview any of our online courses, for free without entering any payment information.
This is not a trial that becomes a subscription or a silly 5 minute preview like other company’s offer. You can now study approximately the first hour of any one of our courses. And you can spend as much time as you like doing so.
This means there is now a lot of content available to you right now. At a typical student speed working for an hour a day, it would take over a month to complete all the content that is available for preview. Continue reading →
While these are very helpful, knowing where to look to find additional validation options is super helpful. For example, what if the State property is only supposed to be required if Country property is set to USA? Good luck with that one! Continue reading →
Here’s a new screencast for you MVC guys and gals out there.
Validating ASP.NET MVC Forms with DataAnnotations
In this short screencast, I will show you how to leverage ASP.NET MVC’s excellent model binding as well as the DataAnnotations attributes to easily add both server-side and client-side validation for MVC websites.
Here’s a quick ASP.NET MVC tip to help you be more productive and write cleaner code. We will see how to leverage C# 4′s optional and default parameters in our action methods for greatly simplifying our code while keeping it fully functional and error free.
Often you want to pass data to your controllers based on URL parameters. This can either be part of the URL itself in the case of route data or it can be part of the query string. In fact, this tip even works for input forms.
Let’s take a basic method which shows some census data, potentially filtered and sorted if that information is passed along, otherwise we’ll just show everything with a default sort.
Want to see some of the topics covered in my blog presented live and in-person? Make your way to London in March 2013 to DevWeek! I’ll be presenting 4 sessions covering NoSQL, ASP.NET MVC, and Cloud (Auzre and AWS mostly). Details below.
Here’s another screencast, this time on MVC and routing.
In this short screencast, I’ll show you everything you need to know to get started with ASP.NET MVC routing. You’ll see how default routes in MVC map to controllers and actions. Next you’ll see how to map additional data from query-strings in addition to simple route data. Finally, we’ll create a custom route to pass additional data in a clean, URL based manor.
As an instructor at DevelopMentor, I have the unique opportunity to watch many developers experience ASP.NET MVC for the first time. This typically goes through several stages:
Extreme Interest (the web is exciting again!)
Confusion (where does the view go again? wait, what’s routing?)
Shock (you have got to be kidding, forearch in the html file?)
Loss (surely there are some drag-and-drop controls, right… right?)
Acceptance (OK, I will learn HTML and CSS after 10 years of working on the web)
Joy and Freedom (How could I have ever used webforms?)
I rarely hear developers who’ve adopted MVC returning to webforms voluntarily. But not everyone makes it to level 6 of MVC enlightenment. So here is an article to help the new comers make it across step 2 more easily as well as help the advanced MVC developers be more productive. Continue reading →
In this screencast, I’ll show you how easy it is to create ASP.NET MVC layout pages based on existing layout pages. This let’s you achieve a nested layout which you can compose to build beautiful websites in MVC with minimal code duplication or effort.
Imagine you’re building an ASP.NET MVC website which has some performance problems. I’m sure this would never actually happen to you, but imagine you’re facing this problem just for the sake of exploring the possibilities. :-)
In this screencast I discuss the how to create strongly-typed razor views in ASP.NET MVC. We look at how Models can be used to pass data (both simple and complex) from controller action methods down to razor views. We also look at the concept of ViewModels which hold aggregate data to pass to views. Finally, we cover some of the tooling for generating views in Visual Studio.
In this screencast I discuss the ViewBag and ViewData properties in ASP.NET MVC. We look at how they can be used to pass data (both simple and complex) from controller action methods down to razor views.
This article covers the various ways in which you might handle text encoding in ASP.NET MVC. For example, if you were writing a forum web app, you should absolutely be paranoid about what your users are typing into your site. You need to be very careful about how you redisplay their input. For example, a friendly forum user might write something like:
If you turn around and show this “post” to your other uses, maybe they’ll get hacked. At a minimum, the evil-doers could be a nuisance to your real users.
On the other hand, if you’re building a CMS or utility helper method, you do not want to filter out the HTML a user might type. They probably need to enter some HTML which you’ll want to show to all the other users. Same thing goes for code your app might generate.
There are at least three ways which MVC manages and encodes (or does not encode) text data. Knowing which scenario you’re targeting allows you to choose the right option. We’ll look at four examples in this post:
A forum app which can be hacked
A forum app which is safe from XSS injection
A CMS app with rich text editing
Generating HTML in code for use in MVC Razor views
Here’s a short screencast I did on understanding the ASP.NET MVC folder structure. As you will see, MVC uses the philosophy of convention over configuration. There are many benefits to this. You simply drop a file here or there, give a class a certain name, etc, and things start to happen. But you must understand how MVC expects you to layout your project.