Posts Tagged ‘.NET’

My Top 5 .NET Resources

I use Google a lot for .NET resources, but I do have a few places I read a lot, and not just to get solutions but also to read about other people’s solutions. Reading about other people’s solutions is a key to learning, and learning is important to any developer’s success. Here are my top resources for .NET related topics:

  • ASP.NET Forums: Ever noted that a lot of the Google search results for ASP.NET point to posts on this forum. Do yourself a favour and register, and try to visit as regularly as possible, try and answer a few questions, or just read the solutions that are posted there. You will learn something. The posts are very fresh and is updated by the minute, so the content grows, so no chance of stagnant content.
  • Scott Guthrie’s blog: This blog has all the latest stuff on it, from ASP.NET MVC to Silverlight. If you want to know whats new make sure you read this blog.
  • Shine Draw: Looking to do something in Silverlight that you have seen done in Flash? Take a look here and maybe you can draw some inspiration.
  • 4 Guys from Rolla: Scott Mitchell has written a lot about .NET, and I read his article about URL Rewriting in ASP.NET on MSDN, so the articles on 4 Guys From Rolla really cover relevant and good topics. I also found that they write the articles in relatively easy to understand language.
  • Codeplex: Is Microsoft’s Open Source project hosting site and contains a lots of .NET projects
  • Share/Bookmark

3 Reasons why C# and Object Oriented Programming Rocks

I have come to really appreciate the quality of and the real possibilities that are associated with C# and object oriented programming, and I thought that maybe I could think of 3 reasons why it rocks. So here are my 3 reasons.

  1. Real-world object mapping: You can take real world objects and turn them into functional, programmable computer objects. If you have a product in your business then you can define that product, through some analysis, and develop it into something that can be represented as a programmable computer object. This is where business objects are created – they are true representations of the actual objects themselves. Object can have relationships with other objects.
  2. Object re-use: If I create an object within any of my web projects, I can re-use the functions of those objects as many times as I want. All I have to do is create an instance of that object and I have access to its functions. This reduces the number of times I have to re-use name spaces. It also allows me to focus on developing and refining my objects, and making changes in fewer places.
  3. Multi-platform and device: C# can be used in windows-based, web-based and mobile applications. Within web and windows applications you can target Silverlight (Web) and WPF (Application) without having to let go of C#. Talk about honing your C# skills!
  • Share/Bookmark

Technology Maturity

Silverlight is not a very mature implementation but the technologies it uses for that implementation aren’t new or unknown. Sure, you have to download a plugin to view Silverlight content, but other than that the technologies that are used in Silverlight are not new. Flash uses ActionScript which closely resembles JavaScript and wonder above wonder Silverlight 1.0 and 1.1 uses JavaScript. Silverlight does use a technology set called XAML, but then again XAML looks and feels like XML. XML is not a new technology either. With Silverlight 2.0 you can use .NET Programming Languages such as C#. Again C# is not a new technology, and even though it has been around for less than 10 years its syntax is strikingly similar to Java and C++, which have been around for longer. Where is all of this coming from? Well in the week, Friday, to be exact I tested a Silverlight 1.x application on a local Intranet. I wanted to see what difficulties users might end up with if required to download the plugin. I sent the URL to a few developers and asked them to test it for me and one question that came back was “How long has this Silverlight technology been around?”, which got me thinking. Silverlight as an implementation is new, yes, but its underlying technology is not. There will be issues with the implementation, as with many technology sets, but the key for me as a developer is that I will be able to take my JavaScript, C#, XML and database skills and be able to build on them with this new technology. From a designer’s perspective Silverlight will not introduce any new technology sets either, because all the graphics elements used within WPF and Silverlight are Vector-based. The graphics elements are represented as XAML and interestingly enough you can export Adobe Illustrator files as XAML and import that directly into Expression Blend and Visual Studio 2008. Personally I think that shows great interoperability.

The point though is that in today’s development environment technology maturity may only point to an implementation specific issue, not a technology subset. The technology subsets that an implementation is focussed on will in all likelihood be a mature technology already.

  • Share/Bookmark

AJAX form validation – LiveValidation

Here’s the thing right, I really want to create a nice contact form for my website, but I also want to make sure that the form accepts the right type of information. For this I need some JavaScript and of late I have been reading a lot about JavaScript libraries such as jquery, mootools and prototype. I have also worked a bit with ASP.NET Ajax, but I do find the .NET implementation does hide a lot of the inner workings of the JavaScript and does not force you to understand the core references as some of the other JavaScript libraries do. With .NET you can get some AJAX running without touching much JavaScript code at all.

So the contact form on my website should allow visitors to send an email with their name, email address and a message. All three fields are required and should not contain empty values. The validation will be done server side, so that the user can see what they are doing wrong immediately and take any necessary steps to correct the information they entered.

One thing that has been bugging me recently has been to find an easy way to validate forms, and I came across LiveValidation. It’s pretty easy to setup and use, and I will be using it to create the form described above.

I also downloaded Amaya, an free XHTML editor, since I am extremely keen on sticking to Web Standards and all.

The basic structure for the form can be seen here. The form requires all three fields and validates the email address field, and if the email address field is found to be valid a alert message box appears on the screen. The underlying JavaScript code is quite interesting to note:

var fld_name = new LiveValidation( 'fld_name', {onlyOnSubmit: true } );
fld_name.add(Validate.Presence);
var fld_email = new LiveValidation( 'fld_email', {onlyOnSubmit: true } );
fld_email.add(Validate.Email);
fld_email.add(Validate.Presence);
var fld_msg = new LiveValidation( 'fld_msg', {onlyOnSubmit: true } );
fld_msg.add(Validate.Presence);
var automaticOnSubmit = fld_email.form.onsubmit;
fld_email.form.onsubmit = function(){
    var valid = automaticOnSubmit();
    if(valid)alert('Thank you for submitting your message!');
    return false;
}
  • Share/Bookmark
Get Adobe Flash playerPlugin by wpburn.com wordpress themes