Archive for the ‘Web Programming’ Category

Can’t Change Country of Adobe Account

Wednesday, November 12th, 2008

Aside the from the bloated abomination that is Acrobat Reader, I can confess that I am a proponent of software from Adobe.  As a long time user of Photoshop and Illustrator, I have always found their products to be powerful and usable.

Recently I’ve taken up time creating applications with a trial version of Flex Builder.  This is the first time I have ever really given a product a full test drive during the trial - normally it gets used once or twice then forgotten about.  Flex Builder is a solid product, built on a great platform.  I can’t get enough of it.

Since I truly like this software, I decided to go ahead and plug in my credit card information to get myself a full copy.  When I got to the Adobe online store though, I was sadly let down by my experience.

I am in Canada but for some reason my existing account has ‘United States’ listed as my address.  Not a big deal, I’ll just change it, right?  No - it is not a changeable field.  You can change your region on the Adobe site but that doesn’t affect your account at all.  If I can’t change my country, I can’t order online because my credit card information will be wrong.

Not a big deal - I called the sales phone number and explained what my problem was, hoping to order the product by phone.  You can’t order software for download by phone, they will only ship it to you.  I’d much rather just have the serial number, so I am transferred to the online support department to get the country of my account changed.

Once I noticed my phone timer had reached 37 minutes, I hung up and tried searching the Internet for a solution to Adobe’s problem.  I found this blog: http://www.gurtle.com/ppov/2008/10/17/adobe-id-customer-service-fail/

Basically, you can’t change your country.  The only way to do it is to create a new account with the correct country.  It would have been nice if the gentleman in sales had known to tell me that instead of letting me wait on hold for an indefinite period of time.

Really, the reason I am most angry is because the muzak that plays on Adobe’s hold line is not just obnoxious, it’s too loud.  Right now my head is ringing and I still have no Flex Builder to play with.

Accessing the stage in Flex

Sunday, November 9th, 2008

When creating components in Flex, designers sometimes need to attach events to the main stage. Unless the application has reached creationComplete, the stage property of custom components will be null.

If you need to, for example, attach a MOUSE_MOVE event to the application stage from a component that doesn’t include a creationComplete override, you have two options.

Wait for Event.ADDED_TO_STAGE

Attach Through the System Manager Object

The system manager parents all displayable elements within the Flex application. It is an elegant way of accessing the stage through custom flex components which have not yet been added to it.

ASP.NET “Service Unavailable”

Saturday, November 8th, 2008

If you have threaded processes called by your ASP.NET code, and those processes crash, your site may start giving Service Unavailable errors.

Use iisreset to quickly get back up and running.

In order to prevent this from occurring at all, I recommend putting try { } catch { } around any statements inside a threaded function.

CommandEventHandler Event Won’t Fire for Button in ASP.NET Custom Control

Wednesday, September 24th, 2008

Problem: I created a custom control with a dynamic button and attached an event handler to that button.  When I run the control, clicking the button causes a postback but the event is not fired.

Solution: Changed the class inheritance from WebControl to CompositeControl.  Re-compiled and it worked like a charm.

FlexBuilder: Flash for Programmers

Thursday, September 11th, 2008

Since I’m not a designer (an obvious conclusion anyone will reach after taking one look at the design of this site), I’ve never had much use for the Flash development environment, nor any real desire to learn it.

Adobe FlexBuilder 3 provides an integrated development environment (Eclipse, actually) that allows programmers to build Flash applications. I was pleasantly surprised to discover this software, and found its brand of MXML to be very familiar coming from an ASP.NET background.

Stay tuned for updates as I learn more about this software. Have you had any experience with it? I welcome comments and suggestions - what should we watch for when working with this software?

JavaScript & Ajax Visual Quickstart Guide

Wednesday, August 13th, 2008

One day last year my client decided we needed to incorporate AJAX into their web site. AJAX was considered the big thing, and by not having “it” we were going to fall behind some of our competitors.

“What do you want to enhance using AJAX?”
“What do you mean? Just install AJAX.”

Ok. I’ve been doing a lot of work with JavaScript for years, including DOM manipulation and other Web 2.0-ish type trickery, but AJAX as a concept was something I had yet to explore. After reading resources available online, I decided to jump ahead a bit and buy a book on the topic.

I picked JavaScript & Ajax, Visual Quickstart Guide for a number of reasons.

  1. It featured a beginner’s look at AJAX
  2. It is part of the Visual Quickstart series - anyone who knows me will know that I love how professionally this series is put together
  3. It features a full-colour DOM object reference flowchart

I will admit this book is not the most comprehensive resource out there, for JavaScript or for AJAX. If I had wanted a more solid reference manual I would likely have sought out a book that focused solely on AJAX or solely on JavaScript. My trusty old tome Mastering JavaScript has always been a great reference, and I won’t get rid of it any time soon.

Although the title of the book is JavaScript & AJAX, the truth is this is a book about JavaScript. Right in the introduction the authors admit they simply added Ajax in this (6th) edition. Beginning the chapter on Ajax, we learn that the name of the book was changed to include Ajax in order to cash in on the success of the methodology. I won’t fault the authors for making that move - in fact I would consider a book about JavaScript to be incomplete nowadays if it did not include a discussion on Ajax.

I bought this book because of its practical discussion. The authors describe generic tricks such as adding dynamic dates and form validation to your site, something older books don’t always consider in much detail. Although the language itself hasn’t really changed since the 90s, the way we use it has. For that reason alone I like to upgrade my bookshelf to keep up with the current trends.

This book features a full colour reference chart for DOM properties. This may not be useful to people who like to use syntax-highlight and code completion software, but I still tend to write JavaScript in plain text editors, so any attribute I don’t know off the top of my head is handy to have at my fingertips.

In all, the authors have done a good job of bringing together a thorough primer for JavaScript. The book identifies itself as targeting beginner to intermediate programmers, an assessment I would tend to agree with. If you’re looking for a decent reference, easy to access, without a lot of jargon, this is the book for you.

ASP.NET: A potentially dangerous Request.Form value was detected from the client

Saturday, August 2nd, 2008

This error is caused by the presence of HTML in the fields returned by a form post.  In many cases, for example page management tools, you may want to allow your users to enter text formatted with HTML.  By default, ASP.NET doesn’t like this.

To turn it off, add ValidateRequest=”false” to the top of your aspx file.  This turns off validation of form results.

Honestly, I would rather if this property were available for individual form controls, because in my mind validation is still desirable overall even if one or two fields should allow HTML.  But there you have it.