Enumerating JavaScript Object Properties

I am building a few controls that use client-side script for reuse in the one web app I’m working on. I needed a way to enumerate the property names and values of an object in JavaScript so I knew which properties I had access to. Here’s a JavaScript method I put together to enumerate the properties of a CustomValidator object. I have the function name as the value of the ClientValidationFunction:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function myValidator(source, args) 
{
    var property, propCollection = ““;

    for(property in source.parentElement)
    {
        propCollection += (property + “: ” + source[property] + “\n“);
    }
    
    alert(propCollection);

    // For now, show the entry as invalid
    args.IsValid = false;
}

Want an Enjoyable Programming Position?

United One Resources, a Wilkes-Barre based corporation, is looking for a Senior Application Developer or Application Architect to help fill a newly created position on the team. The position is reserved for a .NET developer looking to use the latest technologies. United One offers a competitive salary, benefits, and an enjoyable working environment.


If you’re interested, please forward your resume and salary requirments to IWantToProgram [at] UnitedOneResources.com.


 

GoDaddy Denies My Using ASP.NET 3.5 Extensions

I have a domain that I was going to use for a little while as I attempt to sell my home. I registered it with GoDaddy knowing they have .NET support. However, I should have read a little futher into the shared hosting specs. Apparently, GoDaddy only supports ASP.NET 1.1 and 2.0 and does not support any of the later frameworks. I sent them an email asking them if there was a box they could move me to that had 3.5 and they said no and that it’s “not something we are planning on implementing at this time.” Surely I’m confused. Oh well. I guess I’ll have to move it elsewhere. That turned me off of doing any business with GoDaddy in the future.

Best Practice? – Google Redirects 404s

I just read a post a little while ago about the Google Toolbar (beta) redirecting web visitors away from your custom 404 and to a Google 404 page. Besides the issues mentioned on Seoker.com, I’d have a problem as a business owner. This would mean that my visitors and users would be redirected away from my site and could land on a competitors page if they use the Google search bar. So, as a small business owner, I may need to have a bottomless checkbook to ensure this doesn’t happen. As a developer, I’d be upset that Google would do this because I may purposely redirect the user to a correct page. For instance, I have an application right now that sends all 404s to a common HttpHandler. If the handler finds the page in a SQL table, it will redirect the user to the correct URL (ie: mysite.com/special might redirect to mysite.com/products/producta.aspx). I just feel that Google, who complains often that Microsoft forces users to use the Microsoft way, is contradicting itself.


What do you think? Am I wrong in saying that Google has no right to redirect visitors?

How To: Validate HTML Email Content For Outlook 2007

Quite often, we send out automated emails from our .NET applications. Usually they are for our own internal users, but from time to time, they are for external users. Outlook 2007 and Word 2007 revamped the HTML Email rendering. They now use the Word 2007 Schema, a subset of the 4.01 Transitional Schema. Apparently, Word 2007 doesn’t like certain CSS attributes especially if you use normal CSS to layout your email (fixed width divs, etc). More information about this topic can be found by visiting http://msdn2.microsoft.com/en-us/library/aa338200.aspx and http://msdn2.microsoft.com/en-us/library/aa338201.aspx. Microsoft offers a few options to validate your HTML, CSS, XML, etc with the Word 2007 Schema. Using the two links above, you can find all of the aorementioned information.