Subscribe: Robert McLaws: FunWithCoding.NET
Added By: Feedage Forager Feedage Grade B rated
Language: English
add  atlas  code  control  controls  create  microsoft  net  opensearch  provider  response write  string  tfs  time  updatepanel  work 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Robert McLaws: FunWithCoding.NET

Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]


Some Useful TFS Customization Resources

Thu, 15 Nov 2007 21:24:55 GMT

Over the last few days, I've been trying to get my TFS system upgraded with some customizations that members of my team have requested. TFS is a very well-designed system, but unfortunately the out-of-the-box process of customizing your processes leaves a little to be desired.

It took me a couple hours of tinkering, but I figured out how to add some new statuses to the MSF for Agile templates, as well as new fields and UI for tracking the steps to reproduce a bug. I'll be posting those modifications in a bit, but in the meantime, I've assembled some of the resources that I found helpful on my Custom TFS templating journey. I hope they're useful.

And some other cool TFS Stuff:

I'm stepping up the use of TFS on my team for project management, so as I come across more resources that I find useful, I'll post them.

Work With .NET Projects From a Network Share

Thu, 22 Mar 2007 06:03:41 GMT

I've tried a couple different methods from a bunch of different websites, and none of them worked. The only thing that worked for me was this post from the Microsoft Knowledge Base. It is the only place on the internet that gives the proper caspol command for issuing Full Trust to a network share. It is:

Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////\\computername\sharename\*" FullTrust -exclusive on

Note the 4 slashes after the "file" and then the 2 backslashes for the full network path. Trust me, it will save you a lot of headaches.

Expression Web Doesn't Do Non-GAC'd 3rd Party Controls

Thu, 14 Dec 2006 02:19:04 GMT

This is just ridiculous. First Expression web is not for developers, then it goes great with Visual Studio (which is for developers), and now they don't do custom controls that aren't signed and installed in the GAC. What the hell? Did Microsoft have ANY idea what kind of deployment NIGHTMARE that would be? What if the people on your team are writing their own controls that are updated frequently. You mean that the designer has to know enough about the GAC to be constantly pulling the BINs from source control and copy them to the Windows\Assembly folder? Have they not ever dealt with Assembly Hell before?

I'd really like to see what other component vendors and developers have to say about this. Seriously, I don't know what MS is smoking over there, but this whole Expression Web thing is really starting to feel half-assed. I never thought the DevDiv could botch something this badly.

VSTE for DB Professionals MSDN Download Tip

Sat, 09 Dec 2006 20:22:17 GMT

I don't know if this has been posted about yet, but as an FYI to you MSDN subscribers out there, here's an installation tip. There are two downloads for "VSTE for DB Professionals": A 3.2GB full version and a 19MB "trial" version. The naming is a little confusing, but you can install the "trial" version on a fully-licensed VSTS install, and you'll get the full version of VSTEDB.

That will save you from downloading the full 3.2GB install... like I stared to.


ASP.NET: Authenticated but not Authorized

Mon, 04 Dec 2006 08:13:42 GMT

Does anyone know if there is a built-in way to trigger the Membership/Roles/FormsAuth system to redirect to a separate page if the current user is authenticated, but not authorized to view the current page? Right now I'm handling Application.Authenticate and checking UrlAuthorizationModule.CheckUrlAccessForPrincipal, but I'm not sure that's the best way, and it's not as clean as I'd like. Thanks!

Are You Building Cool Solutions with Vista & Office?

Wed, 22 Nov 2006 16:33:00 GMT

I'm helping Microsoft coordinate some launch efforts in the Southwest US. So if you live and work in one of the following areas:

  • Las Vegas
  • Utah
  • Colorado
  • Arizona
  • New Mexico

... and are building cool solutions on Office 2007, Windows Vista, or .NET 3.0, please read this post.

Microsoft, Yahoo Adopt Google Sitemaps

Thu, 16 Nov 2006 07:04:19 GMT is reporting that later today, Microsoft and Yahoo will announce that they are adopting the Sitemaps 0.90 format, formerly known as Google Sitemaps. Now, Community Server users can submit their existing Google Sitemaps feeds to be indexed by the other two top search engine players as well.

This is definitely the best thing to happen to search since OpenSearch.

.NET 3.0 has RTMed!

Tue, 07 Nov 2006 00:56:00 GMT

I've posted the details over at Time to build cool stuff with WPF!

Get Initials from a String in VB.NET

Mon, 16 Oct 2006 06:25:00 GMT

So I've been in way over my head lately, converting a massive spaghetti-code Classic ASP application to .NET 2.0. Recently my client supplied with one of those Intro-to-Programming exam questions that was kinda fun, so I thought I'd post the answer here.

He needed to pull a person's initials out of a string, and he needed to handle either "LastName, FirstName" or "FirstName LastName".

Now, you can't just strip out all the capital letters, because Scottish guys like me will throw a wrench in that logic. So the easies way to do it is to split the string with a space character, and grab the first letter from each resulting string.

So here is the result, with a few test cases called from a test webpage for good measure. Hope you like:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Response.Write(GetInitialsFromString("Robert McLaws") & "
        Response.Write(GetInitialsFromString("Bill Gates") & "
        Response.Write(GetInitialsFromString("Robert W. McLaws") & "
        Response.Write(GetInitialsFromString("McLaws, Robert") & "
        Response.Write(GetInitialsFromString("McLaws, Robert W.") & "
    End Sub

    Public Function GetInitialsFromString(ByVal fullName As String) As String
        If fullName.Contains(",") Then
            fullName = NormalizeName(fullName)
        End If
        Dim nameArray As String() = fullName.Split(" ")
        Dim initials As String = String.Empty
        For Each name As String In nameArray
            initials += name.Chars(0)
        Return initials.ToUpper()
    End Function

    Public Function NormalizeName(ByVal fullName As String) As String
        Dim name As String() = fullName.Split(",")
        Return String.Format("{0} {1}", Trim(name(1)), Trim(name(0)))
    End Function

So if anyone ever needs to do this... there you go :). It's also a useful function for person-related .NET objects, so you can grab the initials by calling PersonObject.Initials instead of having to do it manually.

Leaving VB Developers in the Cold with XNA Express

Wed, 16 Aug 2006 08:02:19 GMT

Do you know VB and want to write games for Windows Vista and the Xbox 360? Sorry, you're SOL... XNA Studio Express is not for you. Didn't you know, man? Real games are made in C#.

What a load of crap.

CommunityServer 2.1 Goodies

Sun, 13 Aug 2006 09:42:00 GMT

I recently whipped out a few CommunityServer 2.1 projects that I thought I should get the word out on:

  • CommunityServerStuff is going to be the package that I dump all my CS goodies into. The first two add-ons are RecycleBinJob, which is a CSJob that empties the deleted items post table on a regular basis; and ReferrerCleanupJob, which is a CSJob that deletes seach engine and social network trackbacks after a user-defined period. This is an expansion and rearchitecture of Keyvan Nayyeri's tips for optimizing your CS database.
  • TrackbackSpamCleanup... well, it does exactly what it's title says. It's an SQL query (based on the same code that ReferrerCleanupJob uses) that cleans up trackback spam and stray URLs leftover from .Text or CS 1.x upgrades.
  • Together, these utilities reduced my DB file from 510MB to 105MB (that's an 80% reduction!!!)
  • Finally, OpenSearchHandler is a DLL-free solution for adding support for searching your CS site from IE7. Just drop the file in the root of your app, make a quick change to your skin, and you're done! (Won't be that way for long tho... I intend to convert the code to C# so I can put it in my CommunityServerStuff package at some point in the near future)

That's about it! I've been neck-deep in Atlas/ASP.NET 2.0/.NET 3.0 development, so hopefully I'll be able to post some more developer tips & tricks soon. Take it easy!

Why is Atlas Taking So Long? It’s the UpdatePanel!

Thu, 15 Jun 2006 12:32:47 GMT

Just stumbled across this article on Yahoo! News. It’s entitled “Microsoft AJAX framework forges ahead in spite of difficulties”. A quote:

San Francisco (InfoWorld) - BOSTON - Microsoft's planned Atlas framework for AJAX (Asynchronous JavaScript and XML) faces difficulty with its development, but promises to be a top-notch offering for the trendy Web scripting technique, a moderator of a TechEd 2006 session said on Wednesday.

One particular feature, Update Panel, is beset with reliability issues, according to moderator Jeff Prosise, co-founder of Microsoft partner Wintellect, a .Net consulting firm. UpdatePanel is an Atlas control that makes it easy to do incremental page refreshes.

Some tough decisions will need to be made pertaining to changes to UpdatePanel, said Prosise, who has been made privy to Atlas development at Microsoft. He declined to be more specific about these decisions, except to say that UpdatePanel will definitely be included in Atlas and that programmers are working on the issue.

"There's some very smart people trying to get that thing to work right now," Prosise said.

"[UpdatePanel is] an incredible piece of code but it doesn't always work. It'll work most of the time," said Prosise. UpdatePanel is not as efficient as hand-coding, but hand-coding takes much longer to do, he said.

I know that from my own personal experience, UpdatePanel can be a royal pain in the butt. I think primarily because it is badly named. People use Panel controls all the time to act as placeholders and what not. I know the Atlas team keeps getting upset because people don’t use the UpdatePanel properly, and I think that is the main reason. UpdateRegion might have been slightly more appropriate.

Then again, I suggested a while back that UpdatePanel should be changed to derive from System.Web.UI.WebControls.Panel, or it should be moved into an Atlas control extender. While I don’t know the technical ramifications of refactoring the control into an Atlas extender, it might be a more versatile approach.

I still think that too many people get hung up on the control aspects of “Atlas”, when it’s really the xml-script that makes it so powerful. It’s only a matter of time before they add a serious design-time experience to client-side web service consumption and complex databinding.

At the end of the day though, it’s still just a browser. I think that WPF (once they nail down the design time experience, which they definitely have not yet) will be the presentation platform with the most promise. At any rate, hopefully the Atlas team will drop another build on the world here pretty soon.

Adding OpenSearch for your CommunityServer Site

Wed, 14 Jun 2006 15:45:00 GMT

So last night, I had this really random idea to create an OpenSearch Provider for That way I could search my site from IE7's search box. In the process, I discovered that my search is broken there, so I decided to create them for several of the main Microsoft community sites instead:

Maybe Telligent will create an OpenSearch directory for all the CS communities out there. We'll have to wait and see. Anyways, if you want to write your own, I'll show you how!

Writing Your Own Provider:

Here's what a CS 2.0 OpenSearch provider looks like:

 Your Name Here
 Your Description Here

When you form your URLs, make sure they are UrlEncoded first, or they'll throw an error.

Installing Your OpenSearch Provider:

You'll have to add a hyperlink to the provider on your website. Just use the following syntax for your link:

That's it! It's really very simple. Of course, you can add a lot more information to your OpenSearch provider. Amazon's A9 has all the details.

E-mail Address Change

Tue, 13 Jun 2006 23:29:00 GMT

My e-mail address no longer works. If anyone's trying to contact me, please use my e-mail address instead. Thanks guys!

Where is the VSTS for Database Professionals CTP?

Mon, 12 Jun 2006 19:12:00 GMT

Microsoft’s homepage for the new Visual Studio Team Suite edition says that the CTP will be available on June 11th, 2006. But it’s June 12th, 2006, and nary a word from Microsoft. So where is the CTP?

Posting to From Word 2007

Mon, 12 Jun 2006 19:04:00 GMT

Ever since Telligent updated to CommunityServer 2.1, I’ve been anxious to try blogging from Word 2007. But the directions in the “Help” link in Word 2007 are incorrect. Fortunately, Chris Garrett already found the solution: the correct MetaBlog API URL is Woo hoo!


Sun, 14 May 2006 21:25:00 GMT

Well, my two-year stint for the real estate company I was working for is over, and I'm back to consulting again. It is a welcome change for me, because educating my business partners on technology was a daily exercise in futility.

I'm available for on- or off-site consulting work, and my rates are flexible. Just use the contact form to drop me a line, and we'll see how I can lend a hand!

Alternate SiteMapProviders and the SiteMapDataSource

Wed, 03 May 2006 20:26:00 GMT

I have a scenario where I think I've found a bug in the SiteMap API in ASP.NET 2.0. The scenario is this:

  1. Create two separate .sitemap files in your application.
  2. Create two SiteMapProvider references in the web.config file. Give them unique names and make one the default.
  3. Create a new webpage. Drag a SiteMapDataSource control onto the page, and specify the name of the non-default SiteMapProvider in the "SiteMapProvider" property.
  4. Drag a Menu control onto the page, and configure it to use the SiteMapDataSource control on the page.

There are two things that I see happening, and I'm wondering ig anyone else sees this:

  1. At Design-time, the Menu will bring up data from the default provider, regardless of the provider you specify.
  2. At runtime, the Menu will not populate with any data.

Is this an issue just with my setup, or are other people seeing this? I dug through the code in Reflector, and I think I found a bug, but I want to make sure I'm not the only one experienceing this first.

"Atlas" Toolkit - Using an Image in a CollapsiblePanelExtender

Mon, 17 Apr 2006 06:30:00 GMT

Want to use an image instead of a text label to trigger the expanding/collapsing events of an "Atlas" CollapsiblePanel? You still use a "Label" control for the trigger, but you switch it up a bit by setting the "ExpandText" and "CollapseText" properties to the HTML code for an image, like this:

        CollapsiblePanelProperties.ExpandedText = "(image) "
        CollapsiblePanelProperties.CollapsedText = "(image) "

It's the same trick you can use in DataGrids to create an image without an image control, and creates the desired effect, as shown below.


In a future post, I'll illustrate in detail how to combine several "Atlas" extenders to create a "Poor Man's Portal" control. I just need to clean up the code and make it a little more "elegant".

The easy way to add controls to the VS2005 Toolbox

Wed, 12 Apr 2006 22:48:00 GMT

Did you know that there is a way to add controls to the Toolbox in Visual Studio 2005 than selececting "Add Items"? Just open Windows Explorer and browse to the assembly containing the controls you want. Select the assembly, and drag it onto the Toolbox, in the tab you want the controls to be in. Visual Studio 2005 will then add any class that has a "ToolboxItem" attribute on it to the Toolbox. Beats having to click a bunch of checkboxes, huh?