DataAnnotations Namespace

Just posted a new article on CodeProject about the new System.ComponentModel.DataAnnotations dll added in SP 3.5.1. If you have not seen this yet it is a really cool set of attributes that allow you to add validation rules to properties as attributes.

Check out the article and let me know what you think. Remember to vote!


http://www.codeproject.com/KB/validation/DataAnnotations.aspx
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

CSLA .NET VB 3.6.3

Finally wrapped up the changes and bug fixes over the weekend for the VB.NET 3.6.3 version and Rocky Lhotka will be posting on his site shortly!
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Progress Made

I've only been at the new contract 6 weeks and I've already have them using NUnit, Lightweight Test Automation Framework, and today I got them to set up TeamCity!

Before I started they were not using any automated unit testing suite and no they joined the dark side :)

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

http://www.setfocus.com/

After my 3 1/2 month vacation (spelled laid off) I finally landed a new position, although it is only a four month contract. What worries me is that it has never taken more than a week or two to find a new position in the Charlotte, NC area so I started thinking about adding to my skill set.

I would like to get into SharePoint development but it seems impossible to get a position without experience in it (make sense) and it is very expensive to set it up at home so I started looking for training. I've attended one/two week training courses before (I won't mention the training facilities since I have nothing nice to say about them) but have always thought the training was superficial, not well thought out and usually focused on the educating the entry level developer. A person I'm working with mentioned Setfocus as something he had looked at before so I started checking them out and on the surface they look ok, although very expensive.

So, here is the question. Has anyone reading this have a comment on the training, placement, cost, facilities, equipment, or even the mascot :) about this training?

Thanks
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Extension Methods

Trying to make some use out of the extra time I have being unemployed I started playing with creating Extension methods which became available with .NET 3.0. Cool functionality when you want to add functionality without altering the original code. I posted an article out on Code Project (http://www.codeproject.com/KB/cs/CreatingExtensionMethods.aspx) that shows how to create an extension for System.String and allows the user to encrypt/decrypt any string object without knowing anything about using RSACryptoServiceProvider.

Go check it out and let me know what you think. I'm considering creating a Extension dll for Excel. When I was working at the banks they used Excel for everything and it might be useful. If you have any thoughts on the subject, let me know.

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

You've got to be kidding

I unemployed right now so I'm stuck looking for a job and one of my weak points is I've never been good at interviewing. I always seem to flub some answer that I know but it never seems to come out right.

So, I'm on this interview with a non-technical hiring manager (who somehow is development manager) and we are going over his list of questions and we hit on Interfaces. So I go over the standard Interface blurb and when I'm done he tells me I'm wrong on the fact that you can not use access modifiers (private and protected specificly) in Interfaces, more over he's seen access modifiers used to limit the scope of the "private set" on properties!

Like I said, I've never been good at interviewing so I inform him that in the .NET world you can not use the access modifiers private and protected in Interfaces and that he might be confused with something he saw in an abstract class. Well, he had it written down on his little sheet and there was no way I was going to win this argument so I let it go. Wonder if I will get this job?

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Lightweight Test Automation Framework

I just found this framework last Friday and really wanted to pass it along to anyone else using ASP.NET. I have been using NUnit for a while now and really do love the fact of being able to write test and know before pushing out a dll that I haven't broken anything during my latest addition, but with ASP.NET there hasn't been (at least as far as I've seen) a way to test the user interface and logic flow until recently. The ASP.NET team wrote a tool (http://www.codeplex.com/aspnet) for them at some point and a couple months ago they posted it for us to use.

I've only been using this framework for a couple days now but I can not say enough good things about it. With very little work I've been able to write test cases for every login scenario I have to support, to include successful logins, missing user names/passwords, prompting user to contact tech support etc. This framework allows you to navigates to pages, wait for the post-back, capture elements on the page look at the values/properties of controls everything you need to test flow through a application.

Starting this week I will begin showing code that I have come up with to test my own web site to demonstrate this framework, so check back.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Meta tag DownloadOptions

I recently convert a ASP.NET 1.1 web app to 2.0 and included MasterPages to define a consistent look, menu etc but ran into a problem with the <meta name="DownloadOptions" content="noopen"/> code. Our site allows users to export data to Excel and text files and also upload pictures and some other file types. Problem is you need to have the <meta name="DownloadOptions" content="noopen"/> tag in the  html <header> which exist in the MasterPage and as you know content pages can not contain top level html content.

For those of you who don't know what <meta name="DownloadOptions" content="noopen"/> does, it modifes the ShowDialog popup and removes the "Open" button so the user only see's the "Save" and "Cancel;" button.

So the problem is, how do I allow users to export to Excel and text files (without the option of "Open" and upload the other files. The way I decided to go is I created a custom attribute class called "ShowDialogNoOpen" and used this attribute on every class in my application that allows exporting files (I don't have an instance where I export and allow the used to upload in one class). Next I put code in the MasterPage file that is called during the Page_Load event that checks if the current "this.Page" has this attribute. If the class does have this attribute I wrote a method that emits a new meta tag. The code is pasted below that shows this.

This is the custom attribute class
public class ShowDiaglogNoOpen: Attribute
{public bool ShowOpen()
{
return false;}

 

}

In the MasterPage I created a method that looks like
private void CheckForAttribute()
{
     MemberInfo  info = this.Page.GetType();
     // Instead of gettting ALL attributes I only want to search for one
     object[] attr = info.GetCustomAttributes(typeof(ShowDialogNoOpen),true);
     // Check if anything was returned
     if(attr != null && attr.GetLength(0) >0)
          EmitMetaTag();
}

 private void EnitMetaTag()
{
    // New class for creating meta tags
    HtmlMeta meta = new HtmlMeta():
    //Use the Name property to specify the meta tag we want to use
    meta.Name = "DownloadOptions";
    //Add the Content param
    meta.Content = "noopen";
    // add this new meta tag to the page
    this.Page.Header.Controls.Add(meta);

}

So, now to stop allowing users the "open" button all I have to do is add [ShowDialogNoOpen] to the class that uses this masterpage and all is well.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

ExtJs Ex not defined

So, for the past 10 months I've been working in ASP.NET, which is a first for me I'm been a desk top / middle tier developer for 99% of my developer career and thing that I don't like about the current application I support is this calendar control we have. The developer before me created a small calendar control that the user click on a icon and the window pops up. Problem with this is the calendar control has no business logic in it, to use it you have to call back the to the server, compile the page and pop it, then user then selects a date and we use javascript to post the value back to the calling page.

Man, that is a lot of work to allow a user to select a date! So, since I'm trying to make things look slicker and run faster I'm working on implementing a ExtJs DatePicker control that hides/displays using the same icon. So I went out to the site and downloaded the Framework and set in to add the control.

I kept getting errors like 'Ext..' is not defined in my main project and I goolged the living heck out of the issue with no luck. Tried different syntax, rearranged script tags all to no avail until I switched the ext-base.js I was using from the file in the ext-2.2\Source\Adapter to the ext-2.2\Adapter\Ext. Not sure what the difference is but there must be one.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati